From 7e807cb82c7104be6d675dcf996b6e87f403df78 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 29 May 2024 21:52:46 +0100 Subject: [PATCH] Core: Remove support for PhantomJS Ref https://github.com/qunitjs/qunit/pull/1505. --- src/globals.js | 2 +- src/html-reporter/html.js | 14 ++------------ test/reorder.js | 3 --- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/globals.js b/src/globals.js index 26e0e614f..863ed92fa 100644 --- a/src/globals.js +++ b/src/globals.js @@ -64,7 +64,7 @@ export const localSessionStorage = (function () { }()); // Basic fallback for ES6 Map -// Support: Safari 7, PhantomJS; Map is undefined +// Support: Safari 7; Map is undefined // Support: iOS 8; `new Map(iterable)` is not supported // // Fallback for ES7 Map#keys diff --git a/src/html-reporter/html.js b/src/html-reporter/html.js index 2169fbfb8..1b0ca97bc 100644 --- a/src/html-reporter/html.js +++ b/src/html-reporter/html.js @@ -1,6 +1,6 @@ import QUnit from '../core'; import { extend, errorString, escapeText } from '../core/utilities'; -import { window, document, navigator, console, StringMap } from '../globals'; +import { window, document, navigator, StringMap } from '../globals'; import fuzzysort from 'fuzzysort'; const stats = { @@ -1068,17 +1068,7 @@ const stats = { testItem.className = 'fail'; }); - // Avoid readyState issue with phantomjs - // Ref: #818 - const usingPhantom = (function (p) { - return (p && p.version && p.version.major > 0); - })(window.phantom); - - if (usingPhantom) { - console.warn('Support for PhantomJS is deprecated and will be removed in QUnit 3.0.'); - } - - if (!usingPhantom && document.readyState === 'complete') { + if (document.readyState === 'complete') { QUnit.autostart(); } else { addEvent(window, 'load', QUnit.autostart); diff --git a/test/reorder.js b/test/reorder.js index 0a9f94143..0a58c84c8 100644 --- a/test/reorder.js +++ b/test/reorder.js @@ -15,9 +15,6 @@ QUnit.test('Second', function (assert) { assert.strictEqual(lastTest, ''); lastTest = 'Second'; - // For some reason PhantomJS mutates config.reorder - QUnit.config.reorder = true; - // This test is "high priority" so it should execute before test "First" // even though it is added to the queue late // eslint-disable-next-line qunit/no-nested-tests