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

perhaps change title of your tests? #55

Closed
y-zaky opened this issue Jul 7, 2017 · 1 comment
Closed

perhaps change title of your tests? #55

y-zaky opened this issue Jul 7, 2017 · 1 comment

Comments

@y-zaky
Copy link

y-zaky commented Jul 7, 2017

Instead of having to repeat yourselves when naming all of your tests, it might be easier to take a different approach. For example, for your first test, instead of repeating the phrase: 'should return an array' on the following lines:

https://github.com/FAC-11/week2-atoms/blob/master/test.js#L5 (first line)
https://github.com/FAC-11/week2-atoms/blob/master/test.js#L8 (second line)

It might be more clear to always keep the first line to be the name of the function this test refers to . i.e. "deleteTodo function'.

Then have the second line to be the actual feature this test will test, so keep it as "should return an array".

@oliverjam
Copy link

It might be worth having another look at the template I laid out in the intro to testing workshop:

// Answer these questions for each unit test you write:
test('What component aspect are you testing?', function(assert) {
  const actual = 'What is the actual output?';
  const expected = 'What is the expected output?';

  assert.equal(actual, expected, 'What should the feature do?');
  assert.end();
});

The first string you give to the test describes what feature you're testing. The second string (given to the assertions) is to describe what the feature you're testing should do.

absorpheus pushed a commit that referenced this issue Jul 7, 2017
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

No branches or pull requests

2 participants