Last active
September 22, 2015 17:29
-
-
Save mattmcgiv/45cb0ab7a21e34f909ad to your computer and use it in GitHub Desktop.
Unit test template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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