I have tried this solution, it not works well.
Here is the example code from the link above:
require([
"doh/runner",
"http://sinonjs.org/releases/sinon-1.17.5.js"
], function(doh){
console.log(sinon);
});
Error message:
$ node ../../dojo/dojo.js load=doh test=tests/test_sinon_spy.js
Error: ENOENT: no such file or directory, open 'http://sinonjs.org/releases/sinon-1.17.5.js'
Besides this, I also try to require sinon.js directly.
sinon-1.17.5.js
have been moved to the directory doh
which is as same as runner.js
, and renamed to sinon
. (The directory )
require([
"doh/runner",
"doh/sinon"
], function(doh, sinon){
console.log(sinon);
});
There is no error message, but sinon is undefined:
$ node ../../dojo/dojo.js load=doh test=tests/test_sinon_spy.js
undefined
0 'tests to run in' 0 'groups'
------------------------------------------------------------
| TEST SUMMARY:
------------------------------------------------------------
0 tests in 0 groups
0 errors
0 failures
I am pretty sure that the second code loads sinon well. I verified that by modifying sinon.js
directly. But I have no idea why sinon is not able to call.
Version
node.js - v6.2.2
dojo/doh - 1.10.0
sinon - 1.17.5