From 5bf56aaaace74ad2b0a1811bb3343ab179d5b5d1 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Thu, 24 Mar 2022 16:30:25 +0100 Subject: [PATCH] chore(test): drop AMD/'requirejs' --- karma.conf.js | 25 ------------ package-lock.json | 38 ------------------- package-scripts.js | 7 +--- package.json | 2 - .../fixtures/requirejs/lib.fixture.js | 3 -- .../fixtures/requirejs/main.fixture.js | 9 ----- test/browser-specific/requirejs-setup.js | 17 --------- 7 files changed, 1 insertion(+), 100 deletions(-) delete mode 100644 test/browser-specific/fixtures/requirejs/lib.fixture.js delete mode 100644 test/browser-specific/fixtures/requirejs/main.fixture.js delete mode 100644 test/browser-specific/requirejs-setup.js diff --git a/karma.conf.js b/karma.conf.js index 2f2c062382..3d8b9d31fe 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -269,7 +269,6 @@ const addSauceLabsTestName = (testName, cfg) => * - `tdd` - `tdd`-specific tests * - `qunit` - `qunit`-specific tests * - `esm` - ESM-specific tests - * - `requirejs` - RequireJS-specific tests * * Since we can't change Mocha's interface on-the-fly, tests for specific interfaces * must be run in isolation. @@ -297,10 +296,6 @@ const chooseTestSuite = (cfg, value) => { case 'esm': return addStandardDependencies({ ...addSauceLabsTestName('ESM Integration Tests', cfg), - // just run against ChromeHeadless, since other browsers may not - // support ESM. - // XXX: remove following line when dropping IE11 - browsers: ['ChromeHeadless'], files: [ { pattern: 'test/browser-specific/fixtures/esm.fixture.mjs', @@ -312,26 +307,6 @@ const chooseTestSuite = (cfg, value) => { } ] }); - case 'requirejs': - // no standard deps because I'm too lazy to figure out how to make - // them work with RequireJS. not important anyway - return { - ...addSauceLabsTestName('RequireJS Tests', cfg), - plugins: [...cfg.plugins, 'karma-requirejs'], - frameworks: ['requirejs', ...cfg.frameworks], - files: [ - { - pattern: 'test/browser-specific/fixtures/requirejs/*.fixture.js', - included: false - }, - 'test/browser-specific/requirejs-setup.js' - ], - // this skips bundling the above tests & fixtures - rollup: { - ...cfg.rollup, - include: [] - } - }; default: return addStandardDependencies({ ...addSauceLabsTestName('Unit Tests', cfg) diff --git a/package-lock.json b/package-lock.json index 662f00abe9..2b7633e419 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,7 +73,6 @@ "karma-chrome-launcher": "^3.1.0", "karma-mocha": "^2.0.1", "karma-mocha-reporter": "^2.2.5", - "karma-requirejs": "^1.1.0", "karma-sauce-launcher": "^4.3.6", "lint-staged": "^10.2.11", "markdown-it": "^12.3.2", @@ -91,7 +90,6 @@ "remark": "^14.0.2", "remark-github": "^11.2.2", "remark-inline-links": "^6.0.1", - "requirejs": "^2.3.6", "rewiremock": "^3.14.3", "rimraf": "^3.0.2", "rollup": "^2.70.1", @@ -12417,16 +12415,6 @@ "node": ">=4" } }, - "node_modules/karma-requirejs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/karma-requirejs/-/karma-requirejs-1.1.0.tgz", - "integrity": "sha1-/driy4fX68FvsCIok1ZNf+5Xh5g=", - "dev": true, - "peerDependencies": { - "karma": ">=0.9", - "requirejs": "^2.1.0" - } - }, "node_modules/karma-sauce-launcher": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/karma-sauce-launcher/-/karma-sauce-launcher-4.3.6.tgz", @@ -19319,19 +19307,6 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, - "node_modules/requirejs": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", - "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", - "dev": true, - "bin": { - "r_js": "bin/r.js", - "r.js": "bin/r.js" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -34241,13 +34216,6 @@ } } }, - "karma-requirejs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/karma-requirejs/-/karma-requirejs-1.1.0.tgz", - "integrity": "sha1-/driy4fX68FvsCIok1ZNf+5Xh5g=", - "dev": true, - "requires": {} - }, "karma-sauce-launcher": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/karma-sauce-launcher/-/karma-sauce-launcher-4.3.6.tgz", @@ -39574,12 +39542,6 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, - "requirejs": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", - "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", - "dev": true - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", diff --git a/package-scripts.js b/package-scripts.js index abd56b8270..b8214a3c33 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -206,7 +206,7 @@ module.exports = { browser: { default: { script: - 'nps clean build test.browser.unit test.browser.bdd test.browser.tdd test.browser.qunit test.browser.esm test.browser.requirejs test.browser.webpack', + 'nps clean build test.browser.unit test.browser.bdd test.browser.tdd test.browser.qunit test.browser.esm test.browser.webpack', description: 'Run browser tests' }, unit: { @@ -234,11 +234,6 @@ module.exports = { description: 'Run browser ES modules support test', hiddenFromHelp: true }, - requirejs: { - script: 'cross-env MOCHA_TEST=requirejs nps test.browser.unit', - description: 'Run RequireJS compat test', - hiddenFromHelp: true - }, webpack: { script: 'webpack --mode development --config ./test/browser-specific/fixtures/webpack/webpack.config.js', diff --git a/package.json b/package.json index f8232aabc0..4ea2cc4f06 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,6 @@ "karma-chrome-launcher": "^3.1.0", "karma-mocha": "^2.0.1", "karma-mocha-reporter": "^2.2.5", - "karma-requirejs": "^1.1.0", "karma-sauce-launcher": "^4.3.6", "lint-staged": "^10.2.11", "markdown-it": "^12.3.2", @@ -132,7 +131,6 @@ "remark": "^14.0.2", "remark-github": "^11.2.2", "remark-inline-links": "^6.0.1", - "requirejs": "^2.3.6", "rewiremock": "^3.14.3", "rimraf": "^3.0.2", "rollup": "^2.70.1", diff --git a/test/browser-specific/fixtures/requirejs/lib.fixture.js b/test/browser-specific/fixtures/requirejs/lib.fixture.js deleted file mode 100644 index 7c0ff46219..0000000000 --- a/test/browser-specific/fixtures/requirejs/lib.fixture.js +++ /dev/null @@ -1,3 +0,0 @@ -define('lib', function() { - return 'foo'; -}); diff --git a/test/browser-specific/fixtures/requirejs/main.fixture.js b/test/browser-specific/fixtures/requirejs/main.fixture.js deleted file mode 100644 index 1e1e1fa25c..0000000000 --- a/test/browser-specific/fixtures/requirejs/main.fixture.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['lib'], function(lib) { - describe('lib', function() { - it('should equal "foo"', function() { - if (lib !== 'foo') { - throw new Error('should be "foo"'); - } - }); - }); -}); diff --git a/test/browser-specific/requirejs-setup.js b/test/browser-specific/requirejs-setup.js deleted file mode 100644 index 8dd5d18979..0000000000 --- a/test/browser-specific/requirejs-setup.js +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable strict */ -(function () { - 'use strict'; - var tests = []; - - for (var file in window.__karma__.files) { - if (/fixture\.js$/.test(file)) { - tests.push(file); - } - } - - require.config({ - baseUrl: '/base', - deps: tests, - callback: window.__karma__.start - }); -})();