I'm using Vows.js to test some node.js which is creating records in a database. As a result of this it creates some test records in the database. I'd like to remove these records once the tests have run. Is there a way to run a cleanup function when a batch of tests is run in Vows?
How to run cleanup with vows.js?
1.6k Views Asked by tooba At
3
There are 3 best solutions below
0

There's an open pull request for vows implementing afterSuite:
https://github.com/phstc/vows/commit/d5b40e85e924e06cca560b4d8d6a264528bbab2b
You can define the
teardown
function in your context that is executed once all the tests in your context are run.You can see this in Vows own tests.