diff options
author | James Lal <james@lightsofapollo.com> | 2013-04-28 19:49:19 -0700 |
---|---|---|
committer | James Lal <james@lightsofapollo.com> | 2013-04-28 19:49:47 -0700 |
commit | 8340549fa7c16e682936b0da26f65671c91311d5 (patch) | |
tree | 8782dbf83fa7b8e53bbdb15e4912d7c90aebe1cf /test/helper.js | |
parent | c439df4388cc4bb5c1777c4dbdc5b164d5192d7f (diff) | |
download | jsCalDAV-8340549fa7c16e682936b0da26f65671c91311d5.tar.gz |
Test framework refactorng + sinon
Diffstat (limited to 'test/helper.js')
-rw-r--r-- | test/helper.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/test/helper.js b/test/helper.js index df0c6d9..2a8c772 100644 --- a/test/helper.js +++ b/test/helper.js @@ -11,7 +11,6 @@ isNode: (typeof(window) === 'undefined') }; - /* stream hack for SAX */ if (!testSupport.isNode) { @@ -48,6 +47,23 @@ } } + /* sinon */ + if (testSupport.isNode) { + global.sinon = require('sinon'); + } else { + window.require('/node_modules/sinon/pkg/sinon.js'); + } + + setup(function() { + this.sinon = sinon.sandbox.create(); + }); + + teardown(function() { + this.sinon.restore(); + }); + + /* chai */ + function setupChai(chai) { chai.Assertion.includeStack = true; assert = chai.assert; @@ -58,7 +74,7 @@ if (testSupport.isNode) { setupChai(require('chai')); } else { - require('/vendor/chai.js', function() { + require('/node_modules/chai/chai.js', function() { setupChai(chai); }); } |