Skip to content

Instantly share code, notes, and snippets.

@mattmcgiv
Last active September 22, 2015 17:29
Show Gist options
  • Save mattmcgiv/45cb0ab7a21e34f909ad to your computer and use it in GitHub Desktop.
Save mattmcgiv/45cb0ab7a21e34f909ad to your computer and use it in GitHub Desktop.
Unit test template
/*
Ref: https://medium.com/javascript-scene/what-every-unit-test-needs-f6cd34d9836d
What are you testing?
What should it do?
What is the actual output?
What is the expected output?
How can the test be reproduced?
The last question is answered by the code used to derive the `actual` value.
*/
// For each unit test you write,
// answer these questions:
test('What component aspect are you testing?', 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();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment