mirror of
https://github.com/vxcontrol/ncform.git
synced 2026-07-21 14:25:29 -04:00
25 lines
822 B
JavaScript
Executable File
25 lines
822 B
JavaScript
Executable File
module.exports = function(root) {
|
|
root = root || global;
|
|
root.expect = root.chai.expect;
|
|
|
|
beforeEach(() => {
|
|
// Using these globally-available Sinon features is preferrable, as they're
|
|
// automatically restored for you in the subsequent `afterEach`
|
|
root.sandbox = root.sinon.sandbox.create();
|
|
root.stub = root.sandbox.stub.bind(root.sandbox);
|
|
root.spy = root.sandbox.spy.bind(root.sandbox);
|
|
root.mock = root.sandbox.mock.bind(root.sandbox);
|
|
root.useFakeTimers = root.sandbox.useFakeTimers.bind(root.sandbox);
|
|
root.useFakeXMLHttpRequest = root.sandbox.useFakeXMLHttpRequest.bind(
|
|
root.sandbox
|
|
);
|
|
root.useFakeServer = root.sandbox.useFakeServer.bind(root.sandbox);
|
|
});
|
|
|
|
afterEach(() => {
|
|
delete root.stub;
|
|
delete root.spy;
|
|
root.sandbox.restore();
|
|
});
|
|
};
|