aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGareth Aye <gaye@mozilla.com>2013-04-29 09:50:15 -0700
committerGareth Aye <gaye@mozilla.com>2013-04-29 09:50:15 -0700
commit9b6e2c616154f2c20fe6272dca083868c02f98f4 (patch)
treeadfd0334e29bb33ae170e8040162e606681ea260 /test
parent90940f2960050812ec0a2897a89de837066056be (diff)
parent8340549fa7c16e682936b0da26f65671c91311d5 (diff)
downloadjsCalDAV-9b6e2c616154f2c20fe6272dca083868c02f98f4.tar.gz
Merge pull request #13 from mozilla-b2g/caldav-sinon
Test framework refactorng + sinon
Diffstat (limited to 'test')
-rw-r--r--test/helper.js20
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);
});
}