Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2525cff

Browse files
authored
Build: Test on Node 17, update Grunt &karma-* packages
This adds testing on Node.js 17 in addition to the currently tested 10, 12, 14and 16 versions.Also, update Grunt & `karma-*` packages.Testing in Karma on jsdom is broken in Node 17 at the moment; until we finda fix, this change disables such testing on Node 17 or newer.Node smoke tests & promises aplus tests are disabled on Node.js 10 as theydepend on jsdom and the latest jsdom version doesn't run properly on Node 10.Closesgh-5023
1 parent6c2c736 commit2525cff

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

‎.github/workflows/node.js.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ jobs:
99
fail-fast:false
1010
matrix:
1111
# Node.js 10 is required by jQuery infra
12-
NODE_VERSION:[10.x, 12.x, 14.x, 16.x]
12+
# Do not remove 16.x until jsdom tests are re-enabled on newer Node.js versions.
13+
NODE_VERSION:[10.x, 12.x, 14.x, 16.x, 17.x]
1314
NPM_SCRIPT:["test:browserless"]
1415
include:
1516
-NAME:"Browser tests: full build, Chrome & Firefox stable"

‎Gruntfile.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = function( grunt ) {
2222
varfs=require("fs"),
2323
gzip=require("gzip-js"),
2424
oldNode=/^v10\./.test(process.version),
25+
nodeV17OrNewer=!/^v1[0246]\./.test(process.version),
2526
isCi=process.env.GITHUB_ACTION,
2627
ciBrowsers=process.env.BROWSERS&&process.env.BROWSERS.split(",");
2728

@@ -362,6 +363,10 @@ module.exports = function( grunt ) {
362363
grunt.log.writeln("Old Node.js detected, running the task \""+task+"\" skipped...");
363364
});
364365

366+
grunt.registerTask("print_jsdom_message",()=>{
367+
grunt.log.writeln("Node.js 17 or newer detected, skipping jsdom tests...");
368+
});
369+
365370
grunt.registerTask("lint",[
366371
"jsonlint",
367372

@@ -381,10 +386,14 @@ module.exports = function( grunt ) {
381386
runIfNewNode("newer:eslint:dist")
382387
]);
383388

384-
grunt.registerTask("test:fast","node_smoke_tests");
389+
grunt.registerTask("test:fast",runIfNewNode("node_smoke_tests"));
385390
grunt.registerTask("test:slow",[
386-
"promises_aplus_tests",
387-
"karma:jsdom"
391+
runIfNewNode("promises_aplus_tests"),
392+
393+
// Support: Node.js 17+
394+
// jsdom fails to connect to the Karma server in Node 17+.
395+
// Until we figure out a fix, skip jsdom tests there.
396+
nodeV17OrNewer ?"print_jsdom_message" :runIfNewNode("karma:jsdom")
388397
]);
389398

390399
grunt.registerTask("test:prepare",[

‎package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,29 @@
3232
"core-js-bundle":"3.6.5",
3333
"eslint-config-jquery":"3.0.0",
3434
"eslint-plugin-import":"2.25.2",
35-
"grunt":"1.2.1",
35+
"grunt":"1.4.1",
3636
"grunt-babel":"8.0.0",
37-
"grunt-cli":"1.3.2",
37+
"grunt-cli":"1.4.3",
3838
"grunt-compare-size":"0.4.2",
3939
"grunt-contrib-uglify":"3.4.0",
4040
"grunt-contrib-watch":"1.1.0",
4141
"grunt-eslint":"24.0.0",
4242
"grunt-git-authors":"3.2.0",
4343
"grunt-jsonlint":"2.1.2",
44-
"grunt-karma":"4.0.0",
44+
"grunt-karma":"4.0.2",
4545
"grunt-newer":"1.3.0",
4646
"grunt-npmcopy":"0.2.0",
4747
"gzip-js":"0.3.2",
4848
"husky":"4.2.5",
4949
"insight":"0.10.3",
50-
"jsdom":"16.3.0",
51-
"karma":"5.1.0",
50+
"jsdom":"19.0.0",
51+
"karma":"^6.3.17",
5252
"karma-browserstack-launcher":"1.6.0",
53-
"karma-chrome-launcher":"3.1.0",
54-
"karma-firefox-launcher":"1.3.0",
53+
"karma-chrome-launcher":"3.1.1",
54+
"karma-firefox-launcher":"2.1.2",
5555
"karma-ie-launcher":"1.0.0",
56-
"karma-jsdom-launcher":"8.0.2",
57-
"karma-qunit":"4.1.1",
56+
"karma-jsdom-launcher":"12.0.0",
57+
"karma-qunit":"4.1.2",
5858
"load-grunt-tasks":"5.1.0",
5959
"native-promise-only":"0.8.1",
6060
"promises-aplus-tests":"2.1.2",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp