From 54380715c18417b34108b6a370fbf9a7820547a7 Mon Sep 17 00:00:00 2001 From: Shachar <34343793+ShaMan123@users.noreply.github.com> Date: Sun, 4 Sep 2022 00:25:44 +0300 Subject: [PATCH] ci(): reintroduce node 14 testing (#8232) --- .github/workflows/tests.yml | 2 +- package-lock.json | 37 +++++++++++++++++++++++++++++++++++++ package.json | 1 + test/node_test_setup.js | 7 +++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6e41bc2bdc9..a7cca6751a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,7 +36,7 @@ jobs: # For more information see: # https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions # supported Node.js release schedule: https://nodejs.org/en/about/releases/ - node-version: [16.x] + node-version: [14.x, 16.x] suite: [unit, visual] steps: - uses: actions/checkout@v2 diff --git a/package-lock.json b/package-lock.json index 836f2b1e354..cad308ddbb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@types/node": "^17.0.21", "@typescript-eslint/eslint-plugin": "^5.29.0", "@typescript-eslint/parser": "^5.29.0", + "abort-controller": "^3.0.0", "auto-changelog": "^2.3.0", "busboy": "^1.6.0", "chalk": "^2.4.1", @@ -1089,6 +1090,18 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "optional": true }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -2969,6 +2982,15 @@ "node": ">= 0.6" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -8257,6 +8279,15 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "optional": true }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "requires": { + "event-target-shim": "^5.0.0" + } + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -9660,6 +9691,12 @@ "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", "dev": true }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true + }, "eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", diff --git a/package.json b/package.json index c9ede7fe97e..a516afe9e04 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,7 @@ "@types/node": "^17.0.21", "@typescript-eslint/eslint-plugin": "^5.29.0", "@typescript-eslint/parser": "^5.29.0", + "abort-controller": "^3.0.0", "auto-changelog": "^2.3.0", "busboy": "^1.6.0", "chalk": "^2.4.1", diff --git a/test/node_test_setup.js b/test/node_test_setup.js index 5a65650f6e5..858b0af5384 100644 --- a/test/node_test_setup.js +++ b/test/node_test_setup.js @@ -3,6 +3,13 @@ var chalk = require('chalk'); var diff = require('deep-object-diff').diff; var commander = require('commander'); +// TODO remove block and dependency when node 14 fades out +// node 14 AbortController polyfill for tests +if (!global.AbortController) { + require("abort-controller/polyfill"); +} + + commander.program .option('-d, --debug', 'debug visual tests by overriding refs (golden images) in case of visual changes', false) .option('-r, --recreate', 'recreate visual refs (golden images)', false)