Last active
January 7, 2017 18:55
-
-
Save samhstn/375b58d208bc564dde13d362ffdb5c96 to your computer and use it in GitHub Desktop.
The uses of `t.plan`
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
``` | |
test(‘test it errors at some point’, (t) => { | |
asyncEvent(‘data that will error’, (err, cb) => { | |
if (err) { | |
t.ok(err); | |
t.end(); | |
} | |
anotherAsyncEvent((err, cb) => { | |
if (err) { | |
t.ok(err); | |
t.end(); | |
} | |
}); | |
}); | |
}); | |
``` | |
is not as nice as: | |
``` | |
test(‘test it errors at some point’, (t) => { | |
t.plan(1); | |
asyncEvent(‘data that will error’, (err, cb) => { | |
if (err) { | |
t.ok(err); | |
} | |
anotherAsyncEvent((err, cb) => { | |
if (err) { | |
t.ok(err); | |
} | |
}); | |
}); | |
}); | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment