latest release broke require('sinon')
See original GitHub issuemkdir newproj && cd newproj
npm init -y
npm i -S sinon@3.2.1
node -e 'require("sinon")'
Ouptut:
~/newproj/node_modules/just-extend/index.js:40
throw new Error('expected object, got ' + arg);
^
Error: expected object, got function FakeXMLHttpRequest(config) {
EventTargetHandler.call(this);
this.readyState = FakeXMLHttpRequest.UNSENT;
this.requestHeaders = {};
this.requestBody = null;
this.status = 0;
this.statusText = "";
this.upload = new EventTargetHandler();
this.responseType = "";
this.response = "";
this.logError = configureLogError(config);
if (sinonXhr.supportsTimeout) {
this.timeout = 0;
}
if (sinonXhr.supportsCORS) {
this.withCredentials = false;
}
if (typeof FakeXMLHttpRequest.onCreate === "function") {
FakeXMLHttpRequest.onCreate(this);
}
}
at extend (~/newproj/node_modules/just-extend/index.js:40:13)
at Object.<anonymous> (~/newproj/node_modules/nise/lib/fake-xhr/index.js:651:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (~newproj/node_modules/nise/lib/fake-server/index.js:3:15)
$ npm ls just-extend
newproj@1.0.0 ~/newproj
└─┬ sinon@3.2.1
└─┬ nise@1.1.1
└── just-extend@1.1.24
$ node --version
v6.11.0
Re: sinonjs/sinon#1591
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:8 (1 by maintainers)
Top Results From Across the Web
AMD: Built version from master is broken · Issue #555 - GitHub
I was installing the latest pre-built version from sinon.org. I'll just start working my way back releases until I find one that works....
Read more >Changelog - Sinon.JS
The major release is caused by removing old mistakes and upgrading dependencies that themselves have had new major releases. Upgrade nise, @sinonjs/formatio, @ ......
Read more >Mocking with Sinon against a service module - Stack Overflow
You can see that my createUser method takes a user Object as a parameter and passes this to a database module where it...
Read more >Why isn't my Stub working (Using Sinon Stubs — part II)
This post tells the mysterious story of a Sinon stub that refused to work...
Read more >karma-sinon-chai - npm
Fixed broken Sinon dependency · Updated depenencies. Chai: ~3.0 => ~3.2.0; Sinon: ~1.15.0 => ~1.16.0 · Removed lodash dependency ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Very sorry for this. Latest just-extend has the fix (v1.1.26)
Thanks for fixing it so quickly @angus-c 👍