Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#64228 new defect (bug)

Update `sinon` npm dependency

Reported by: desrosj's profile desrosj Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: good-first-bug has-patch
Focuses: javascript Cc:

Description

The Sinon dependency is used to create spies and stubs for use within QUnit tests.

There are some breaking changes that are causing issues in the test suite that need to be addressed before upgrading.

Here is the output when running npm run grunt qunit:compiled using sinon@21.0.0:

Running "qunit:files" (qunit) task
Testing tests/qunit/compiled.html JQMIGRATE: Migrate is installed, version 3.4.1
Failed to load resource: net::ERR_FILE_NOT_FOUND
.............................................................................................Access to XMLHttpRequest at 'file:///wp-admin/admin-ajax.php' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
Failed to load resource: net::ERR_FAILED
.....................................................................................FF.................................
>> dashboard > communityEvents.getTimeZone > modern browsers should return a time zone name
>> Message: undefined
>> Actual: UTC
>> Expected: America/Chicago
>>   at Object.<anonymous> (file:///home/runner/work/wordpress-develop/wordpress-develop/tests/qunit/wp-admin/js/dashboard.js:154:12)
>>     at callSandboxedFn (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:172:29)
>>     at Object.sinonAsyncSandboxedTest (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:192:30)
>> dashboard > communityEvents.getTimeZone > older browsers should fallback to a raw UTC offset
>> Message: negative offset
>> Actual: UTC
>> Expected: -300
>>   at Object.<anonymous> (file:///home/runner/work/wordpress-develop/wordpress-develop/tests/qunit/wp-admin/js/dashboard.js:166:12)
>>     at callSandboxedFn (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:172:29)
>>     at Object.sinonAsyncSandboxedTest (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:192:30)
>> Message: no offset
>> Actual: UTC
>> Expected: 0
>>   at Object.<anonymous> (file:///home/runner/work/wordpress-develop/wordpress-develop/tests/qunit/wp-admin/js/dashboard.js:170:12)
>>     at callSandboxedFn (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:172:29)
>>     at Object.sinonAsyncSandboxedTest (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:192:30)
>> Message: positive offset
>> Actual: UTC
>> Expected: 300
>>   at Object.<anonymous> (file:///home/runner/work/wordpress-develop/wordpress-develop/tests/qunit/wp-admin/js/dashboard.js:174:12)
>>     at callSandboxedFn (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:172:29)
>>     at Object.sinonAsyncSandboxedTest (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:192:30)
Testing tests/qunit/index.html JQMIGRATE: Migrate is installed with logging active, version 3.4.1
Failed to load resource: net::ERR_FILE_NOT_FOUND
.............................................................................................Access to XMLHttpRequest at 'file:///wp-admin/admin-ajax.php' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
Failed to load resource: net::ERR_FAILED
.....................................................................................FF.................................
>> dashboard > communityEvents.getTimeZone > modern browsers should return a time zone name
>> Message: undefined
>> Actual: UTC
>> Expected: America/Chicago
>>   at Object.<anonymous> (file:///home/runner/work/wordpress-develop/wordpress-develop/tests/qunit/wp-admin/js/dashboard.js:154:12)
>>     at callSandboxedFn (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:172:29)
>>     at Object.sinonAsyncSandboxedTest (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:192:30)
>> dashboard > communityEvents.getTimeZone > older browsers should fallback to a raw UTC offset
>> Message: negative offset
>> Actual: UTC
>> Expected: -300
>>   at Object.<anonymous> (file:///home/runner/work/wordpress-develop/wordpress-develop/tests/qunit/wp-admin/js/dashboard.js:166:12)
>>     at callSandboxedFn (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:172:29)
>>     at Object.sinonAsyncSandboxedTest (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:192:30)
>> Message: no offset
>> Actual: UTC
>> Expected: 0
>>   at Object.<anonymous> (file:///home/runner/work/wordpress-develop/wordpress-develop/tests/qunit/wp-admin/js/dashboard.js:170:12)
>>     at callSandboxedFn (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:172:29)
>>     at Object.sinonAsyncSandboxedTest (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:192:30)
>> Message: positive offset
>> Actual: UTC
>> Expected: 300
>>   at Object.<anonymous> (file:///home/runner/work/wordpress-develop/wordpress-develop/tests/qunit/wp-admin/js/dashboard.js:174:12)
>>     at callSandboxedFn (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:172:29)
>>     at Object.sinonAsyncSandboxedTest (file:///home/runner/work/wordpress-develop/wordpress-develop/node_modules/sinon-test/dist/sinon-test.js:192:30)
Warning: 426 tests completed in 5685ms, with 4 failed, 0 skipped, and 0 todo. Use --force to continue.

Change History (2)

This ticket was mentioned in PR #10465 on WordPress/wordpress-develop by @desrosj.


4 weeks ago
#1

  • Keywords has-patch added

This updates all devDependencies for 6.9 except:

  • webpack: It's a bit too late to update this confidently.
  • sinon: This has some breaking changes that need to be addressed (see Core-64228).

Trac ticket: Core-63171

Note: See TracTickets for help on using tickets.