Created
January 11, 2011 05:40
-
-
Save peterwmwong/774074 to your computer and use it in GitHub Desktop.
Vows teardown test case with console.log
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
vows.describe("Vows with teardowns").addBatch({ | |
"A context": { | |
topic: function () { | |
return { flag: true }; | |
}, | |
"And a vow": function (topic) { | |
assert.isTrue(topic.flag); | |
}, | |
"And another vow": function (topic) { | |
assert.isTrue(topic.flag); | |
}, | |
"And a final vow": function (topic) { | |
assert.isTrue(topic.flag); | |
}, | |
teardown: function (topic) { | |
/*******************************/ | |
console.log('TEAR DOWN CALLED'); | |
/*******************************/ | |
topic.flag = false; | |
} | |
} | |
}).export(module); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems to be working over here...
♢ Vows with teardowns
A context
✓ And a vow
✓ And another vow
✓ And a final vow
✓ OK » 3 honored (0.002s)
TEAR DOWN CALLED
Marak-Squiress-MacBook-Pro:vows maraksquires$
Are you saying that you don't see the console output if you run this suite? Also, I checked the teardown code a bit in suite.js and it appears the teardown only executes if the suite was successful.