Skip to content

Commit 733e62d

Browse files
authored
Tests: migrate test runner to jquery-test-runner
Closes jquerygh-5604
1 parent 4466770 commit 733e62d

29 files changed

+1239
-4033
lines changed

.github/workflows/browserstack-dispatch.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,6 @@ jobs:
5959
run: npm run pretest
6060

6161
- name: Run tests
62-
run: npm run test:unit -- -v --browserstack ${{ inputs.browser }} -m ${{ inputs.module }}
62+
run: npm run test:unit -- \
63+
-v --browserstack ${{ inputs.browser }} \
64+
-f module=${{ inputs.module }}

.github/workflows/browserstack.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
env:
1313
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
1414
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
15-
NODE_VERSION: 20.x
15+
NODE_VERSION: 22.x
1616
name: ${{ matrix.BROWSER }}
1717
concurrency:
1818
group: ${{ github.workflow }}-${{ matrix.BROWSER }}
@@ -61,4 +61,7 @@ jobs:
6161
run: npm run pretest
6262

6363
- name: Run tests
64-
run: npm run test:unit -- -v --browserstack "${{ matrix.BROWSER }}" --run-id ${{ github.run_id }} --isolate --retries 3 --hard-retries 1
64+
run: |
65+
npm run test:unit -- -v -c jtr-isolate.yml \
66+
--browserstack "${{ matrix.BROWSER }}" \
67+
--run-id ${{ github.run_id }}

.github/workflows/filestash.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
if: ${{ github.repository == 'jquery/jquery' }}
1717
environment: filestash
1818
env:
19-
NODE_VERSION: 20.x
19+
NODE_VERSION: 22.x
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/node.js.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@ jobs:
2020
NPM_SCRIPT: ["test:browserless"]
2121
include:
2222
- NAME: "Node"
23-
NODE_VERSION: "20.x"
23+
NODE_VERSION: "22.x"
2424
NPM_SCRIPT: "lint"
2525
- NAME: "Chrome/Firefox"
26-
NODE_VERSION: "20.x"
26+
NODE_VERSION: "22.x"
2727
NPM_SCRIPT: "test:browser"
2828
- NAME: "Chrome"
29-
NODE_VERSION: "20.x"
29+
NODE_VERSION: "22.x"
3030
NPM_SCRIPT: "test:slim"
3131
- NAME: "Chrome"
32-
NODE_VERSION: "20.x"
32+
NODE_VERSION: "22.x"
3333
NPM_SCRIPT: "test:no-deprecated"
3434
- NAME: "Chrome"
35-
NODE_VERSION: "20.x"
35+
NODE_VERSION: "22.x"
3636
NPM_SCRIPT: "test:selector-native"
3737
- NAME: "Chrome"
38-
NODE_VERSION: "20.x"
38+
NODE_VERSION: "22.x"
3939
NPM_SCRIPT: "test:esm"
4040
- NAME: "Firefox ESR (new)"
41-
NODE_VERSION: "20.x"
41+
NODE_VERSION: "22.x"
4242
NPM_SCRIPT: "test:firefox"
4343
- NAME: "Firefox ESR (old)"
44-
NODE_VERSION: "20.x"
44+
NODE_VERSION: "22.x"
4545
NPM_SCRIPT: "test:firefox"
4646
steps:
4747
- name: Checkout
@@ -80,7 +80,7 @@ jobs:
8080
- name: Install dependencies
8181
run: npm install
8282

83-
- name: Build All for Linting
83+
- name: Build all for linting
8484
run: npm run build:all
8585
if: contains(matrix.NPM_SCRIPT, 'lint')
8686

@@ -90,7 +90,7 @@ jobs:
9090
ie:
9191
runs-on: windows-latest
9292
env:
93-
NODE_VERSION: 20.x
93+
NODE_VERSION: 22.x
9494
name: test:ie - IE
9595
steps:
9696
- name: Checkout
@@ -118,7 +118,7 @@ jobs:
118118
safari:
119119
runs-on: macos-latest
120120
env:
121-
NODE_VERSION: 20.x
121+
NODE_VERSION: 22.x
122122
name: test:safari - Safari
123123
steps:
124124
- name: Checkout

.github/workflows/verify-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# skip on forks
2020
if: ${{ github.repository == 'jquery/jquery' }}
2121
env:
22-
NODE_VERSION: 20.x
22+
NODE_VERSION: 22.x
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

CONTRIBUTING.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ This will only run the "css" module tests. This will significantly speed up your
131131

132132
#### Change the test server port
133133

134-
The default port for the test server is 3000. You can change the port by setting the `PORT` environment variable.
134+
The default port for the test server is 3000. You can change the port by setting the `--port` option.
135135

136136
```bash
137-
$ PORT=3001 npm run test:server
137+
$ npm run test:server -- --port 8000
138138
```
139139

140140
#### Loading changes on the test page
@@ -165,14 +165,34 @@ Make sure jQuery is built (`npm run build:all`) and run the tests:
165165
$ npm run test:unit
166166
```
167167

168-
This will run each module in its own browser instance and report the results in the terminal.
168+
This will run all tests and report the results in the terminal.
169169

170170
View the full help for the test suite for more info on running the tests from the command line:
171171

172172
```bash
173173
$ npm run test:unit -- --help
174174
```
175175

176+
#### Running a single module
177+
178+
All test modules run by default. Run a single module by specifying the module in a "flag":
179+
180+
```bash
181+
$ npm run test:unit -- --flag module=css
182+
```
183+
184+
Or, run multiple modules with multiple flags (`-f` is shorthand for `--flag`):
185+
186+
```bash
187+
$ npm run test:unit -- -f module=css -f module=effects
188+
```
189+
190+
Anything passed to the `--flag` option is passed as query parameters on the QUnit test page. For instance, run tests with unminified code with the `dev` flag:
191+
192+
```bash
193+
$ npm run test:unit -- -f dev
194+
```
195+
176196
### Repo organization
177197

178198
The jQuery source is organized with ECMAScript modules and then compiled into one file at build time.

jtr-isolate.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 1
2+
3+
base-url: /test/
4+
5+
runs:
6+
module:
7+
- basic
8+
- ajax
9+
- animation
10+
- attributes
11+
- callbacks
12+
- core
13+
- css
14+
- data
15+
- deferred
16+
- deprecated
17+
- dimensions
18+
- effects
19+
- event
20+
- manipulation
21+
- offset
22+
- queue
23+
- selector
24+
- serialize
25+
- support
26+
- traversing
27+
- tween
28+
29+
retries: 3
30+
hard-retries: 1

0 commit comments

Comments
 (0)