Created
November 23, 2017 11:41
-
-
Save wolframkriesing/7f86e01b799926e5b0d49b442bf1c1d8 to your computer and use it in GitHub Desktop.
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
const tap = require('tap'); | |
const test = tap.test; | |
function findImageDimensions() { | |
return {width: 100, height: 100}; | |
} | |
// this FAILS | |
test('Find image dimensions', (t) => { | |
t.test('if requested size matches, return it', (t) => { | |
const dimensions = findImageDimensions(); | |
t.same(dimensions, {width: 100, height: 100}); | |
}); | |
}); | |
// this PASSES | |
test('Find image dimensions', (t) => { | |
t.test('if requested size matches, return it', (t) => { | |
const dimensions = findImageDimensions(); | |
t.same(dimensions, {width: 100, height: 100}); | |
t.end(); | |
}); | |
t.end(); | |
}); | |
// though the docs say "there is no need to call tap.end() explicitly" | |
// http://www.node-tap.org/api/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment