Skip to content

Commit

Permalink
Build: Fix tests in IE 10 & 9, ensure ES5 in tests
Browse files Browse the repository at this point in the history
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.

Closes gh-532
  • Loading branch information
mgol authored Sep 18, 2024
1 parent 95d05ce commit 4166af2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/unit/jquery/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ QUnit[ jQueryVersionSince( "4.0.0" ) ? "test" : "skip" ]( "jQuery.fn.sort", func
var elem = jQuery( "<span></span><div></div><p></p>" );

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;
}
Expand Down

0 comments on commit 4166af2

Please sign in to comment.