diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2022-03-14 17:58:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-14 17:58:41 +0100 |
commit | 2525cffc42934c0d5c7aa085bc45dd6a8282e840 (patch) | |
tree | da9cc1f9a2dd87bac6e92a93375ab2f413d7f64b /Gruntfile.js | |
parent | 6c2c7362fb18d3df7c2a7b13715c2763645acfcb (diff) | |
download | jquery-2525cffc42934c0d5c7aa085bc45dd6a8282e840.tar.gz jquery-2525cffc42934c0d5c7aa085bc45dd6a8282e840.zip |
Build: Test on Node 17, update Grunt & `karma-*` packages
This adds testing on Node.js 17 in addition to the currently tested 10, 12, 14
and 16 versions.
Also, update Grunt & `karma-*` packages.
Testing in Karma on jsdom is broken in Node 17 at the moment; until we find
a fix, this change disables such testing on Node 17 or newer.
Node smoke tests & promises aplus tests are disabled on Node.js 10 as they
depend on jsdom and the latest jsdom version doesn't run properly on Node 10.
Closes gh-5023
Diffstat (limited to 'Gruntfile.js')
-rw-r--r-- | Gruntfile.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 7514c9a75..687b3215c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -22,6 +22,7 @@ module.exports = function( grunt ) { var fs = require( "fs" ), gzip = require( "gzip-js" ), oldNode = /^v10\./.test( process.version ), + nodeV17OrNewer = !/^v1[0246]\./.test( process.version ), isCi = process.env.GITHUB_ACTION, ciBrowsers = process.env.BROWSERS && process.env.BROWSERS.split( "," ); @@ -362,6 +363,10 @@ module.exports = function( grunt ) { grunt.log.writeln( "Old Node.js detected, running the task \"" + task + "\" skipped..." ); } ); + grunt.registerTask( "print_jsdom_message", () => { + grunt.log.writeln( "Node.js 17 or newer detected, skipping jsdom tests..." ); + } ); + grunt.registerTask( "lint", [ "jsonlint", @@ -381,10 +386,14 @@ module.exports = function( grunt ) { runIfNewNode( "newer:eslint:dist" ) ] ); - grunt.registerTask( "test:fast", "node_smoke_tests" ); + grunt.registerTask( "test:fast", runIfNewNode( "node_smoke_tests" ) ); grunt.registerTask( "test:slow", [ - "promises_aplus_tests", - "karma:jsdom" + runIfNewNode( "promises_aplus_tests" ), + + // Support: Node.js 17+ + // jsdom fails to connect to the Karma server in Node 17+. + // Until we figure out a fix, skip jsdom tests there. + nodeV17OrNewer ? "print_jsdom_message" : runIfNewNode( "karma:jsdom" ) ] ); grunt.registerTask( "test:prepare", [ |