-
-
Save ericelliott/bc4c0fb66973202f6680 to your computer and use it in GitHub Desktop.
Anatomy of a Unit Test
This file contains hidden or 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
import test from 'tape'; | |
// 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
Thanks, Super helpful!
For those who didn't come here directly from the article, you should check it out:
5 Questions Every Unit Test Must Answer.