Closed herodrigues closed 7 years ago
Hi, @herodrigues . https://github.com/9joneg/karma-sinon-chrome/issues/3
Sinon.JS v1.x as source doesn't work with AMD loaders / RequireJS / Webpack / Browserify.
This has been resolved in Sinon v2.x
https://github.com/sinonjs/sinon#important-sinon-v1x-does-not-work-with-amdcommonjs-bundlers
So, there is no solution yet?
So, we should wait sinon 2 stable version (now 2.0.0-pre.2).
Thanks @acvetkov.
I followed your instructions in https://github.com/acvetkov/sinon-chrome/issues/11
Here is my solution for those who need it.
requirejs
, I used webpack
sinon@next
via npmsinon-chrome
and karma-sinon-chrome
via npmMy webpack.config.js:
var webpack = require('webpack');
var path = require('path');
module.exports = {
resolve: {
modulesDirectories: ['node_modules'],
alias: {
sinon: path.resolve(__dirname, 'node_modules/sinon/pkg/sinon.js')
},
extensions: ['', '.js', '.jsx']
},
module: {
noParse: []
}
}
I know that there is a karma sinon-chrome wrap, but I could not find any reliable solution to what I'm looking for. I'm getting this error:
My spec file
I installed sinon-chrome and karma-sinon-chrome via npm. My karma config file: