From 3448cfb448c0427928640b4a92bde40491abb9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Tue, 17 Sep 2024 23:25:55 +0200 Subject: [PATCH] Build: Fix tests in IE 10 & 9, ensure ES5 in tests 1. Change `const`s in `core.js` tests to a `var` to avoid crashes in IE 9 & 10. 2. Modify the ESLint config to require ES5 in tests. --- eslint.config.js | 8 ++++++-- package-lock.json | 4 ++-- test/unit/jquery/core.js | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index a83d79b0..929e7367 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -89,10 +89,12 @@ export default [ { files: [ "test/unit/**" ], languageOptions: { - ecmaVersion: 2015, + ecmaVersion: 5, sourceType: "script", globals: { ...globals.browser, + Promise: false, + Symbol: false, jQuery: false, QUnit: false, url: false, @@ -117,10 +119,12 @@ export default [ files: [ "test/data/**" ], ignores: [ "test/data/jquery-*.js", "test/data/qunit-start.js" ], languageOptions: { - ecmaVersion: 2015, + ecmaVersion: 5, sourceType: "script", globals: { ...globals.browser, + Promise: false, + Symbol: false, global: false, jQuery: false, QUnit: false, diff --git a/package-lock.json b/package-lock.json index 82ef8940..d91b2e7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jquery-migrate", - "version": "3.5.1-pre", + "version": "3.5.3-pre", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jquery-migrate", - "version": "3.5.1-pre", + "version": "3.5.3-pre", "license": "MIT", "devDependencies": { "@types/selenium-webdriver": "4.1.22", diff --git a/test/unit/jquery/core.js b/test/unit/jquery/core.js index 293fb81a..ce0e17d8 100644 --- a/test/unit/jquery/core.js +++ b/test/unit/jquery/core.js @@ -477,8 +477,8 @@ QUnit[ jQueryVersionSince( "4.0.0" ) ? "test" : "skip" ]( "jQuery.fn.sort", func var elem = jQuery( "

" ); elem.sort( function( node1, node2 ) { - const tag1 = node1.tagName.toLowerCase(); - const tag2 = node2.tagName.toLowerCase(); + var tag1 = node1.tagName.toLowerCase(), + tag2 = node2.tagName.toLowerCase(); if ( tag1 < tag2 ) { return -1; }