Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Js calculator post #2

Merged
merged 5 commits into from
Feb 4, 2019
Merged

Js calculator post #2

merged 5 commits into from
Feb 4, 2019

Conversation

SDries
Copy link
Owner

@SDries SDries commented Feb 4, 2019

No description provided.

@SDries SDries requested a review from astrserc February 4, 2019 15:31
demolink: "-SITE_URL-/projects/vanilla-js-calculator/index.html"
---
<p>
It had been a while since I made anything using javascript. As an exercise I reproduced as much of the windows calculator functionality as possible.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It had been a while since I made anything using javascript. As an exercise, I reproduced as much of the windows calculator functionality as possible.

I decided against using a framework because I wanted to focus on javascript instead of some framework. Using a framework might have made this easier but the focus of the exercise would have been different.
</p>
<p>
While I was at it I also decided to write tests and to generate reports about my tests.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I was at it, I also decided to write tests and to generate reports about my tests.

<h2>Jasmine</h2>

<p>
From previous experience i learned that, without realizing it, you will break your own application.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From previous experience, I learned that, without realizing it, you will break your own application.


<p>
From previous experience i learned that, without realizing it, you will break your own application.
To make sure I could break pieces without knowing about it something was required to verify that every piece of code worked as expected.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure I could break pieces without knowing about it, something was required to verify that every piece of code worked as expected.

--> not sure if you meant what you said? "To make sure I could break pieces without knowing about it,"?

"Jasmine is a behavior-driven development framework for testing JavaScript code."
</p>
<p>
In practice, this means that anytime I modified my code Jasmine would tell me whether or not my code still worked. There's a catch though, I have to tell Jasmine what to test. This means that if I forget something or I make a mistake in one of my tests, this will be reflected in the report.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In practice, this means that anytime I modified my code Jasmine would tell me whether or not my code still worked. There's a catch though: I have to tell Jasmine what to test. This means that if I forget something or I make a mistake in one of my tests, this will be reflected in the report.

In practice, this means that anytime I modified my code Jasmine would tell me whether or not my code still worked. There's a catch though, I have to tell Jasmine what to test. This means that if I forget something or I make a mistake in one of my tests, this will be reflected in the report.
</p>
<p>
A best practices when writing tests for your code is to write them before you write the code that will be tested.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A best practice when writing tests for your code is to write them before you write the code that will be tested.

@SDries SDries merged commit 46ad09c into master Feb 4, 2019
@SDries SDries deleted the js-calculator-post branch February 4, 2019 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants