Pulling In Sinon Submodules In Browser With AMD And Webpack
I'm running into the same problem described in this question. Basically sinon only pulls in all required submodules if you're using node. If you try to use it in the browser with A
Solution 1:
The following seems to work:
exports.sinon = require("sinon");
exports.sinon.spy = require("sinon/lib/sinon/spy");
exports.sinon.spyCall = require("sinon/lib/sinon/call");
exports.sinon.behavior = require("sinon/lib/sinon/behavior");
exports.sinon.stub = require("sinon/lib/sinon/stub");
exports.sinon.mock = require("sinon/lib/sinon/mock");
exports.sinon.collection = require("sinon/lib/sinon/collection");
exports.sinon.assert = require("sinon/lib/sinon/assert");
exports.sinon.sandbox = require("sinon/lib/sinon/sandbox");
exports.sinon.test = require("sinon/lib/sinon/test");
exports.sinon.testCase = require("sinon/lib/sinon/test_case");
exports.sinon.match = require("sinon/lib/sinon/match");
This is basically mimicking the behavior in sinon.js. If anyone has a better/cleaner solution please post it and I'll accept. And now that I look at it I wonder why there're
Post a Comment for "Pulling In Sinon Submodules In Browser With AMD And Webpack"