This is some very strange interaction between different things. Steps to reproduce:
- Check out Update Stylelint dependencies patch set 1
- Enter a Fresh environment
- Run npm i
- Run npx grunt jasmine_nodejs stylelint (or a full npx grunt test if you want, but only these two tasks are relevant)
Stylelint will fail:
Running "stylelint:all" (stylelint) task Warning: Invalid URL: lib/utils/FileCache.cjs Use --force to continue. Aborted due to warnings.
You can further narrow this down to see that the jsdom helper specifically is the culprit:
diff --git a/Gruntfile.js b/Gruntfile.js index 4d6cd1da81..4f39140801 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -54,6 +54,5 @@ module.exports = function ( grunt ) { specs: [ - 'tests/jasmine/**/*.spec.js' ], helpers: [ - 'tests/jasmine/helpers/*.js' + 'tests/jasmine/helpers/jsdom.js' ]
Specifically, the line require( 'jsdom-global' )(); in there is the problem (if you comment it out, Stylelint works again).
Unfortunately, just commenting out the jsdom-global line also makes the Jasmine tests fail, so we need to find a better solution for this.