From 3757f2b3f47be11935f1f4ed6d9eabd7745ba168 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 15 Jul 2024 15:08:42 +0100 Subject: [PATCH] Test: Move various files to a new "browser-runner" subdir We've moved most files in this directory out already. The two remaining files relate to the now-decoupled browser runner, not the HTML Reporter. Move several other clearly browser-specific test files there as well. --- Gruntfile.js | 15 ++++++++------- test/{ => browser-runner}/amd.html | 6 +++--- test/{ => browser-runner}/amd.js | 0 test/{ => browser-runner}/autostart.html | 4 ++-- test/{ => browser-runner}/autostart.js | 0 .../{ => browser-runner}/config-fixture-null.html | 4 ++-- test/{ => browser-runner}/config-fixture-null.js | 0 .../config-fixture-string.html | 4 ++-- .../{ => browser-runner}/config-fixture-string.js | 0 test/{ => browser-runner}/headless.html | 10 ++++++---- .../window-onerror-preexisting-handler.html | 2 +- .../window-onerror-preexisting-handler.js | 2 +- .../window-onerror.html | 2 +- .../window-onerror.js | 2 +- test/cli/structure.js | 2 +- test/main/browser-runner.js | 4 ++-- 16 files changed, 30 insertions(+), 27 deletions(-) rename test/{ => browser-runner}/amd.html (67%) rename test/{ => browser-runner}/amd.js (100%) rename test/{ => browser-runner}/autostart.html (88%) rename test/{ => browser-runner}/autostart.js (100%) rename test/{ => browser-runner}/config-fixture-null.html (70%) rename test/{ => browser-runner}/config-fixture-null.js (100%) rename test/{ => browser-runner}/config-fixture-string.html (71%) rename test/{ => browser-runner}/config-fixture-string.js (100%) rename test/{ => browser-runner}/headless.html (76%) rename test/{reporter-html => browser-runner}/window-onerror-preexisting-handler.html (86%) rename test/{reporter-html => browser-runner}/window-onerror-preexisting-handler.js (97%) rename test/{reporter-html => browser-runner}/window-onerror.html (74%) rename test/{reporter-html => browser-runner}/window-onerror.js (93%) diff --git a/Gruntfile.js b/Gruntfile.js index 8d8eba8a3..b4244f926 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -73,14 +73,9 @@ module.exports = function (grunt) { urls: [ 'test/index.html', - 'test/amd.html', - 'test/autostart.html', - 'test/config-fixture-null.html', - 'test/config-fixture-string.html', 'test/dynamic-import.html', 'test/events-filters.html', 'test/events-in-test.html', - 'test/headless.html', 'test/index-es5.html', 'test/index-xhtml.xhtml', 'test/logs.html', @@ -106,8 +101,14 @@ module.exports = function (grunt) { 'test/webWorker.html', 'demos/q4000-qunit.html', - 'test/reporter-html/window-onerror-preexisting-handler.html', - 'test/reporter-html/window-onerror.html' + + 'test/browser-runner/amd.html', + 'test/browser-runner/autostart.html', + 'test/browser-runner/config-fixture-null.html', + 'test/browser-runner/config-fixture-string.html', + 'test/browser-runner/headless.html', + 'test/browser-runner/window-onerror-preexisting-handler.html', + 'test/browser-runner/window-onerror.html' ].map(file => `http://localhost:${connectPort}/${file}`) } diff --git a/test/amd.html b/test/browser-runner/amd.html similarity index 67% rename from test/amd.html rename to test/browser-runner/amd.html index 9dd617076..8f098498e 100644 --- a/test/amd.html +++ b/test/browser-runner/amd.html @@ -3,9 +3,9 @@ amd - - - + + +
diff --git a/test/amd.js b/test/browser-runner/amd.js similarity index 100% rename from test/amd.js rename to test/browser-runner/amd.js diff --git a/test/autostart.html b/test/browser-runner/autostart.html similarity index 88% rename from test/autostart.html rename to test/browser-runner/autostart.html index 0606f3676..bb09d236f 100644 --- a/test/autostart.html +++ b/test/browser-runner/autostart.html @@ -3,11 +3,11 @@ autostart - +
- + + + diff --git a/test/config-fixture-null.js b/test/browser-runner/config-fixture-null.js similarity index 100% rename from test/config-fixture-null.js rename to test/browser-runner/config-fixture-null.js diff --git a/test/config-fixture-string.html b/test/browser-runner/config-fixture-string.html similarity index 71% rename from test/config-fixture-string.html rename to test/browser-runner/config-fixture-string.html index 75d14b49b..8e0328888 100644 --- a/test/config-fixture-string.html +++ b/test/browser-runner/config-fixture-string.html @@ -3,8 +3,8 @@ config-fixture-string - - + + diff --git a/test/config-fixture-string.js b/test/browser-runner/config-fixture-string.js similarity index 100% rename from test/config-fixture-string.js rename to test/browser-runner/config-fixture-string.js diff --git a/test/headless.html b/test/browser-runner/headless.html similarity index 76% rename from test/headless.html rename to test/browser-runner/headless.html index f4a5ae0e4..90740e98e 100644 --- a/test/headless.html +++ b/test/browser-runner/headless.html @@ -3,10 +3,12 @@ headless - - - - + + + + + + diff --git a/test/reporter-html/window-onerror.js b/test/browser-runner/window-onerror.js similarity index 93% rename from test/reporter-html/window-onerror.js rename to test/browser-runner/window-onerror.js index 7d6aa238e..ecac8af08 100644 --- a/test/reporter-html/window-onerror.js +++ b/test/browser-runner/window-onerror.js @@ -1,5 +1,5 @@ /* eslint-env browser */ -QUnit.module('window.onerror (no preexisting handler)', function (hooks) { +QUnit.module('window.onerror [no preexisting handler]', function (hooks) { var originalOnUncaught; hooks.beforeEach(function () { diff --git a/test/cli/structure.js b/test/cli/structure.js index 8fabfa6ef..89b09de38 100644 --- a/test/cli/structure.js +++ b/test/cli/structure.js @@ -73,7 +73,7 @@ QUnit.module('structure', () => { }); QUnit.module('test/**.html', () => { - // Get a list of the HTML files, including in subdirectories (e.g. "test/reporter-html/"). + // Get a list of the HTML files, including in subdirectories (e.g. "test/browser-runner/"). const files = glob('**/*.html', { cwd: path.join(__dirname, '..'), filesOnly: true diff --git a/test/main/browser-runner.js b/test/main/browser-runner.js index 2e25b4317..18fed20f3 100644 --- a/test/main/browser-runner.js +++ b/test/main/browser-runner.js @@ -25,13 +25,13 @@ QUnit.module('browser-runner', function () { QUnit.test('example', function (assert) { var done = assert.async(); - this.expectedFailure = 'global failure: Error: Error thrown in non-returned promise!'; + this.expectedFailure = 'global failure: Error: Example from non-returned promise!'; // eslint-disable-next-line compat/compat -- Checked Promise.resolve().then(function () { // prevent test from exiting before unhandled rejection fires setTimeout(done, 20); - throw new Error('Error thrown in non-returned promise!'); + throw new Error('Example from non-returned promise!'); }); }); });