Skip to content

Commit d14ba1d

Browse files
authored
Test: replace grunt-contrib-qunit with jQuery test runner
Close gh-135
1 parent 40db125 commit d14ba1d

38 files changed

+6340
-599
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
indent_style = tab
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
13+
[*.yml]
14+
indent_style = space
15+
indent_size = 2

.eslintrc.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
{
3737
"files": [
3838
"jquery.color.*",
39+
"test/jquery.js",
3940
"test/data/*.js",
4041
"test/unit/*.js"
4142
],
@@ -47,18 +48,6 @@
4748
"browser": true,
4849
"node": false
4950
}
50-
},
51-
52-
{
53-
"files": [ "test/karma/*.js" ],
54-
"parserOptions": {
55-
"ecmaVersion": 2018
56-
},
57-
"env": {
58-
"es6": true,
59-
"browser": false,
60-
"node": true
61-
}
6251
}
6352
]
6453
}

.github/workflows/node.js.yml

Lines changed: 121 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,129 @@
1-
name: CI
1+
name: Node
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
branches-ignore: "dependabot/**"
7+
# Once a week every Monday
8+
schedule:
9+
- cron: "42 1 * * 1"
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
NODE_VERSION: 20.x
416

517
jobs:
6-
build:
18+
build-and-test:
719
runs-on: ubuntu-latest
20+
name: ${{ matrix.BROWSER }}
821
strategy:
922
fail-fast: false
1023
matrix:
11-
# Node.js 10 is required by jQuery infra
12-
NODE_VERSION: [10.x, 18.x]
13-
NPM_SCRIPT: ["ci"]
14-
include:
15-
- NAME: "Browser tests"
16-
NODE_VERSION: "18.x"
17-
NPM_SCRIPT: "browserstack"
24+
BROWSER: [chrome, firefox]
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
29+
30+
- name: Use Node.js ${{ env.NODE_VERSION }}
31+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
32+
with:
33+
node-version: ${{ env.NODE_VERSION }}
34+
35+
- name: Cache
36+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
37+
with:
38+
path: ~/.npm
39+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
40+
restore-keys: |
41+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
42+
43+
- name: Install npm dependencies
44+
run: npm install
45+
46+
- name: Build
47+
run: npm run build
48+
49+
- name: Test
50+
run: |
51+
npm run test:unit -- -h -b ${{ matrix.BROWSER }} \
52+
--jquery 1.8.3 --jquery 1.9.1 --jquery 1.10.2 --jquery 1.11.3 --jquery 1.12.4 \
53+
--jquery 2.0.3 --jquery 2.1.4 --jquery 2.2.4 \
54+
--jquery 3.0.0 --jquery 3.1.1 --jquery 3.2.1 --jquery 3.3.1 \
55+
--jquery 3.4.1 --jquery 3.5.1 --jquery 3.6.4 --jquery 3.7.1 \
56+
--jquery 3.x-git --jquery git \
57+
--retries 3 --hard-retries 1
58+
59+
edge:
60+
runs-on: windows-latest
61+
name: edge
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
65+
66+
- name: Use Node.js ${{ env.NODE_VERSION }}
67+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
68+
with:
69+
node-version: ${{ env.NODE_VERSION }}
70+
71+
- name: Cache
72+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
73+
with:
74+
path: ~/.npm
75+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
76+
restore-keys: |
77+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
78+
79+
- name: Install dependencies
80+
run: npm install
81+
82+
- name: Build
83+
run: npm run build
84+
85+
- name: Test
86+
run: |
87+
npm run test:unit -- -h -b edge `
88+
--jquery 1.8.3 --jquery 1.9.1 --jquery 1.10.2 --jquery 1.11.3 --jquery 1.12.4 `
89+
--jquery 2.0.3 --jquery 2.1.4 --jquery 2.2.4 `
90+
--jquery 3.0.0 --jquery 3.1.1 --jquery 3.2.1 --jquery 3.3.1 `
91+
--jquery 3.4.1 --jquery 3.5.1 --jquery 3.6.4 --jquery 3.7.1 `
92+
--jquery 3.x-git --jquery git `
93+
--retries 3 --hard-retries 1
94+
95+
safari:
96+
runs-on: macos-latest
97+
name: safari
1898
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v2
21-
22-
- name: Cache
23-
uses: actions/cache@v2
24-
with:
25-
path: ~/.npm
26-
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
27-
restore-keys: |
28-
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
29-
30-
- name: Use Node.js ${{ matrix.NODE_VERSION }}
31-
uses: actions/setup-node@v2.1.2
32-
with:
33-
node-version: ${{ matrix.NODE_VERSION }}
34-
35-
- name: Install dependencies
36-
run: |
37-
npm install
38-
39-
- name: Run tests
40-
env:
41-
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
42-
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
43-
run: |
44-
export PATH=${HOME}/firefox:$PATH
45-
npm run ${{ matrix.NPM_SCRIPT }}
99+
- name: Checkout
100+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
101+
102+
- name: Use Node.js ${{ env.NODE_VERSION }}
103+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
104+
with:
105+
node-version: ${{ env.NODE_VERSION }}
106+
107+
- name: Cache
108+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
109+
with:
110+
path: ~/.npm
111+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
112+
restore-keys: |
113+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
114+
115+
- name: Install dependencies
116+
run: npm install
117+
118+
- name: Build
119+
run: npm run build
120+
121+
- name: Test
122+
run: |
123+
npm run test:unit -- -b safari \
124+
--jquery 1.8.3 --jquery 1.9.1 --jquery 1.10.2 --jquery 1.11.3 --jquery 1.12.4 \
125+
--jquery 2.0.3 --jquery 2.1.4 --jquery 2.2.4 \
126+
--jquery 3.0.0 --jquery 3.1.1 --jquery 3.2.1 --jquery 3.3.1 \
127+
--jquery 3.4.1 --jquery 3.5.1 --jquery 3.6.4 --jquery 3.7.1 \
128+
--jquery 3.x-git --jquery git \
129+
--retries 3 --hard-retries 1

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
/dist
33
/external
44
/node_modules
5-
/package-lock.json
65
/*.log
76
/*.err

0 commit comments

Comments
 (0)