qunit-once
QUnit plugin that adds setupOne and teardownOnce to modules
Available through bower and npm as qunit-once.
Tested in the browser by QUnit and under nodejs by qunit-node. Safe to use with gt, which includes setupOnce and teardownOnce already.
API
QUnit;
Use
install
Include qunit-once.js after qunit.js in HTML
Or install qunit-once via npm install qunit-once --save-dev
under node.
Write unit tests
// tests.js var counter = 0; QUnit; QUnit; QUnit;
Run under node using node-qunit or gt
npm install -g qunitqunit -d qunit-once.js -c tests.js -t tests.js
You don't need to include this module when running with gt, it already supports setupOnce and teardownOnce methods.
Related
Run QUnit module setup once, Testing code with async setup, qunit-promises
Small print
Author: Gleb Bahmutov © 2013 @bahmutov
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github