Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Test setup file
'use strict';
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
chai.config.includeStack = true;
var sinon = require('sinon');
require('sinon-as-promised');
sinon.assert.expose(chai.assert, {
prefix: ''
});
var privateState = require('privatestate');
privateState.restore = sinon.stub().throws(
new chai.AssertionError('Do not use privatestate.restore. All modules are automatically restored after each test.')
);
var sinonSandbox = require('sinon-sandbox');
afterEach(function() {
privateState.restoreAll();
if (sinonSandbox.clock) {
sinonSandbox.clock.restore();
}
sinonSandbox.restore();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment