Skip to content

Commit b685753

Browse files
authored
Tests: Migrate test runner to jquery-test-runner
Closes gh-2325
1 parent 44b0b0a commit b685753

29 files changed

+132
-1886
lines changed

.github/workflows/filestash.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
environment: filestash
1515
env:
16-
NODE_VERSION: 20.x
16+
NODE_VERSION: 22.x
1717
name: Update Filestash
1818
steps:
1919
- name: Checkout

.github/workflows/node.js.yml

+18-24
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ permissions:
1212
contents: read
1313

1414
env:
15-
NODE_VERSION: 20.x
15+
NODE_VERSION: 22.x
1616

1717
jobs:
1818
build-and-test:
1919
runs-on: ubuntu-latest
2020
name: |
21-
${{ matrix.BROWSER }} | ${{ matrix.JQUERYS.name }}
21+
${{ matrix.BROWSER }} | ${{ matrix.CONFIGS.name }}
2222
strategy:
2323
fail-fast: false
2424
matrix:
2525
BROWSER: [chrome, firefox]
26-
JQUERYS:
27-
- versions: --jquery git --jquery 3.x-git
26+
CONFIGS:
27+
- config: jtr-git.yml
2828
name: jQuery git
29-
- versions: --jquery 3.7.1 --jquery 3.6.4 --jquery 2.2.4 --jquery 1.12.4
29+
- config: jtr-stable.yml
3030
name: jQuery stable
3131

3232
steps:
@@ -57,21 +57,21 @@ jobs:
5757

5858
- name: Test
5959
run: |
60-
npm run test:unit -- -h -b ${{ matrix.BROWSER }} \
61-
${{ matrix.JQUERYS.versions }} \
62-
--retries 3 --hard-retries 1
60+
npm run test:unit -- \
61+
--headless -b ${{ matrix.BROWSER }} \
62+
-c ${{ matrix.CONFIGS.config }}
6363
6464
edge:
6565
runs-on: windows-latest
6666
name: |
67-
edge | ${{ matrix.JQUERYS.name }}
67+
edge | ${{ matrix.CONFIGS.name }}
6868
strategy:
6969
fail-fast: false
7070
matrix:
71-
JQUERYS:
72-
- versions: --jquery git --jquery 3.x-git
71+
CONFIGS:
72+
- config: jtr-git.yml
7373
name: jQuery git
74-
- versions: --jquery 3.7.1 --jquery 3.6.4 --jquery 2.2.4 --jquery 1.12.4
74+
- config: jtr-stable.yml
7575
name: jQuery stable
7676
steps:
7777
- name: Checkout
@@ -97,22 +97,19 @@ jobs:
9797
run: npm run build
9898

9999
- name: Test
100-
run: |
101-
npm run test:unit -- -h -b edge `
102-
${{ matrix.JQUERYS.versions }} `
103-
--retries 3 --hard-retries 1
100+
run: npm run test:unit -- -- --headless -b edge -c ${{ matrix.CONFIGS.config }}
104101

105102
safari:
106103
runs-on: macos-latest
107104
name: |
108-
safari | ${{ matrix.JQUERYS.name }}
105+
safari | ${{ matrix.CONFIGS.name }}
109106
strategy:
110107
fail-fast: false
111108
matrix:
112-
JQUERYS:
113-
- versions: --jquery git --jquery 3.x-git
109+
CONFIGS:
110+
- config: jtr-git.yml
114111
name: jQuery git
115-
- versions: --jquery 3.7.1 --jquery 3.6.4 --jquery 2.2.4 --jquery 1.12.4
112+
- config: jtr-stable.yml
116113
name: jQuery stable
117114
steps:
118115
- name: Checkout
@@ -138,7 +135,4 @@ jobs:
138135
run: npm run build
139136

140137
- name: Test
141-
run: |
142-
npm run test:unit -- -b safari \
143-
${{ matrix.JQUERYS.versions }} \
144-
--retries 3 --hard-retries 1
138+
run: npm run test:unit -- -b safari -c ${{ matrix.CONFIGS.config }}

jtr-git.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: 1
2+
3+
base-url: /tests/unit/
4+
5+
test-urls:
6+
- accordion/accordion.html
7+
- autocomplete/autocomplete.html
8+
- button/button.html
9+
- checkboxradio/checkboxradio.html
10+
- controlgroup/controlgroup.html
11+
- core/core.html
12+
- datepicker/datepicker.html
13+
- dialog/dialog.html
14+
- draggable/draggable.html
15+
- droppable/droppable.html
16+
- effects/effects.html
17+
- form-reset-mixin/form-reset-mixin.html
18+
- jquery-patch/jquery-patch.html
19+
- menu/menu.html
20+
- position/position.html
21+
- progressbar/progressbar.html
22+
- resizable/resizable.html
23+
- selectable/selectable.html
24+
- selectmenu/selectmenu.html
25+
- slider/slider.html
26+
- sortable/sortable.html
27+
- spinner/spinner.html
28+
- tabs/tabs.html
29+
- tooltip/tooltip.html
30+
- widget/widget.html
31+
32+
runs:
33+
jquery:
34+
- git
35+
- 3.x-git
36+
37+
retries: 2
38+
hard-retries: 1

jtr-stable.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
version: 1
2+
3+
base-url: /tests/unit/
4+
5+
test-urls:
6+
- accordion/accordion.html
7+
- autocomplete/autocomplete.html
8+
- button/button.html
9+
- checkboxradio/checkboxradio.html
10+
- controlgroup/controlgroup.html
11+
- core/core.html
12+
- datepicker/datepicker.html
13+
- dialog/dialog.html
14+
- draggable/draggable.html
15+
- droppable/droppable.html
16+
- effects/effects.html
17+
- form-reset-mixin/form-reset-mixin.html
18+
- jquery-patch/jquery-patch.html
19+
- menu/menu.html
20+
- position/position.html
21+
- progressbar/progressbar.html
22+
- resizable/resizable.html
23+
- selectable/selectable.html
24+
- selectmenu/selectmenu.html
25+
- slider/slider.html
26+
- sortable/sortable.html
27+
- spinner/spinner.html
28+
- tabs/tabs.html
29+
- tooltip/tooltip.html
30+
- widget/widget.html
31+
32+
runs:
33+
jquery:
34+
- 3.7.1
35+
- 3.6.4
36+
- 2.2.4
37+
- 1.12.4
38+
39+
retries: 2
40+
hard-retries: 1

jtr.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 1
2+
3+
base-url: /tests/unit/
4+
5+
test-urls:
6+
- accordion/accordion.html
7+
- autocomplete/autocomplete.html
8+
- button/button.html
9+
- checkboxradio/checkboxradio.html
10+
- controlgroup/controlgroup.html
11+
- core/core.html
12+
- datepicker/datepicker.html
13+
- dialog/dialog.html
14+
- draggable/draggable.html
15+
- droppable/droppable.html
16+
- effects/effects.html
17+
- form-reset-mixin/form-reset-mixin.html
18+
- jquery-patch/jquery-patch.html
19+
- menu/menu.html
20+
- position/position.html
21+
- progressbar/progressbar.html
22+
- resizable/resizable.html
23+
- selectable/selectable.html
24+
- selectmenu/selectmenu.html
25+
- slider/slider.html
26+
- sortable/sortable.html
27+
- spinner/spinner.html
28+
- tabs/tabs.html
29+
- tooltip/tooltip.html
30+
- widget/widget.html

package.json

+5-12
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,16 @@
4747
"scripts": {
4848
"build": "grunt build",
4949
"lint": "grunt lint",
50-
"test:server": "node tests/runner/server.js",
51-
"test:unit": "node tests/runner/command.js",
52-
"test": "grunt && npm run test:unit -- -h"
50+
"test:server": "jtr serve",
51+
"test:unit": "jtr",
52+
"test": "grunt && npm run test:unit -- --headless"
5353
},
5454
"dependencies": {
5555
"jquery": ">=1.12.0 <5.0.0"
5656
},
5757
"devDependencies": {
58-
"body-parser": "1.20.3",
59-
"browserstack-local": "1.5.5",
6058
"commitplease": "3.2.0",
61-
"diff": "5.2.0",
6259
"eslint-config-jquery": "3.0.2",
63-
"exit-hook": "4.0.0",
64-
"express": "4.21.1",
65-
"express-body-parser-error-handler": "1.0.7",
6660
"grunt": "1.6.1",
6761
"grunt-bowercopy": "1.2.5",
6862
"grunt-compare-size": "0.4.2",
@@ -73,10 +67,9 @@
7367
"grunt-eslint": "24.0.1",
7468
"grunt-git-authors": "3.2.0",
7569
"grunt-html": "17.1.0",
70+
"jquery-test-runner": "0.2.1",
7671
"load-grunt-tasks": "5.1.0",
77-
"rimraf": "6.0.1",
78-
"selenium-webdriver": "4.26.0",
79-
"yargs": "17.7.2"
72+
"rimraf": "6.0.1"
8073
},
8174
"keywords": []
8275
}

tests/lib/qunit.js

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ QUnit.config.requireExpects = true;
1313
QUnit.config.urlConfig.push( {
1414
id: "jquery",
1515
label: "jQuery version",
16-
17-
// Keep in sync with tests/runner/jquery.js
1816
value: [
1917
"1.12.4",
2018
"2.2.4",

tests/runner/.eslintrc.json

-38
This file was deleted.

0 commit comments

Comments
 (0)