We are using sinon v2.x through mw-node-qunit. I've updated the major version of mw-node-qunit to 3 to update sinon to the latest version, 4.x.
Sinon has upgraded major version with breaking changes in July, so our tests are not compatible with the library now and going forward unless we update them.
See migration guides and changelog:
- http://sinonjs.org/guides/migrating-to-3.0
- http://sinonjs.org/guides/migrating-to-4.0
- https://github.com/joakin/mw-node-qunit/blob/master/CHANGELOG.md#300
Here is a test run with the failures:
$ npm i mw-node-qunit@latest $ npm ls mw-node-qunit └── mw-node-qunit@3.0.0 $ npm run test:node > @ test:node /Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popu ps > node tests/node-qunit/run.js 'tests/node-qunit/**/*.test.js' | tap-dot .xxxxxxxxxxxxxxxxxxx.xxx.......................xxxx.......................... ............................................................................... ............................................................................... ............................................................................... ............................................................................... .......................................................................x 387 tests 438 passed 27 failed Failed Tests: There were 27 failures x beforeEach failed on #linkDwell: stub(obj, 'meth', fn) has been removed,see documentation, expected: undefined, got: null, test: #linkDwell, module: ext.popups/actions#linkDwell @integration, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:116:7) x beforeEach failed on #linkDwell doesn't continue when previews are disabled: stub(obj, 'meth', fn) has been removed, see documentation, expected: undefined, got: null, test: #linkDwell doesn't continue when previews are disabled, module: ext.popups/actions#linkDwell @integration, source: TypeError: stub(obj,'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:166:7) x beforeEach failed on #linkDwell doesn't continue if the token has changed: stub(obj, 'meth', fn) has been removed, see documentation, expected: undefined, got: null, test: #linkDwell doesn't continue if the token has changed, module: ext.popups/actions#linkDwell @integration, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:194:7) x beforeEach failed on #linkDwell dispatches the fetch action: stub(obj, 'meth', fn) has been removed, see documentation, expected: undefined, got: null,test: #linkDwell dispatches the fetch action, module: ext.popups/actions#linkDwell @integration, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:232:7) x beforeEach failed on it should fetch data from the gateway immediately: stub(obj, 'meth', fn) has been removed, see documentation, expected: undefined,got: null, test: it should fetch data from the gateway immediately, module: ext.popups/actions#fetch, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:287:7) x beforeEach failed on it should dispatch the FETCH_END action when the API request ends: stub(obj, 'meth', fn) has been removed, see documentation, expected: undefined, got: null, test: it should dispatch the FETCH_END action when the API request ends, module: ext.popups/actions#fetch, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:306:7) x beforeEach failed on it should delay dispatching the FETCH_COMPLETE action: stub(obj, 'meth', fn) has been removed, see documentation, expected: undefined, got: null, test: it should delay dispatching the FETCH_COMPLETE action, module: ext.popups/actions#fetch, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:326:7) x beforeEach failed on it should dispatch the FETCH_FAILED action when therequest fails: stub(obj, 'meth', fn) has been removed, see documentation, expected: undefined, got: null, test: it should dispatch the FETCH_FAILED action when the request fails, module: ext.popups/actions#fetch, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:378:7) x beforeEach failed on it should dispatch the FETCH_FAILED action when therequest fails even after the wait timeout: stub(obj, 'meth', fn) has been removed, see documentation, expected: undefined, got: null, test: it should dispatch the FETCH_FAILED action when the request fails even after the wait timeout, module: ext.popups/actions#fetch, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:401:7) x beforeEach failed on it should dispatch start and end actions: stub(obj,'meth', fn) has been removed, see documentation, expected: undefined, got: null, test: it should dispatch start and end actions, module: ext.popups/actions#abandon, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Have you spoken with #Design about changing this value?, expected: true,got: false, test: it should dispatch start and end actions, module: ext.popups/actions#abandon, source: at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:456:9) x Died on test #4 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/actions.test.js:433:7) x beforeEach failed on it shouldn't dispatch under certain conditions: stub(obj, 'meth', fn) has been removed, see documentation, expected: undefined, got: null, test: it shouldn't dispatch under certain conditions, module: ext.popups/actions#abandon, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x beforeEach failed on it should show the preview with the behavior: stub(obj, 'meth', fn) has been removed, see documentation, expected: undefined, got:null, test: it should show the preview with the behavior, module: ext.popups/changeListeners/render, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/changeListeners/render.test.js:14:7) x beforeEach failed on it should render the preview: stub(obj, 'meth', fn)has been removed, see documentation, expected: undefined, got: null, test: it should render the preview, module: ext.popups/changeListeners/render, source: TypeError: stub(obj, 'meth', fn) has been removed, see documentation x Died on test #2 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/changeListeners/render.test.js:40:7) x Died on test #1 at Object.<anonymous> (/Users/jhernandez/dev/wikimedia/vagrant/mediawiki/extensions/Popups/tests/node-qunit/wait.test.js:5:7) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ test:node: `node tests/node-qunit/run.js 'tests/node-qunit/**/*.test.js' | tap-dot` npm ERR! Exit status 1
ac
- tests are adapted to sinon 4.x
- popups uses mw-node-qunit 3.x