Skip to content

Commit 8fcbffd

Browse files
committed
Refactor package.json and GitHub Actions workflow for improved testing setup. Change dependency versions to fixed values, update test commands to use web-test-runner configuration, and streamline installation steps in the CI pipeline.
1 parent 7e77891 commit 8fcbffd

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

.github/workflows/deployment.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
with:
2626
node-version: 18
2727
cache: 'npm'
28-
- name: Install dependencies
28+
- name: Clean install
2929
run: |
30+
rm -rf node_modules package-lock.json
3031
npm install -g [email protected]
3132
npm ci
32-
- name: Install test dependencies
33+
- name: Install Playwright browsers
3334
run: |
34-
3535
npx playwright install --with-deps chromium firefox webkit
3636
- name: Run tests
37-
run: npx web-test-runner --config web-test-runner.config.cjs
37+
run: npm test
3838
test_win:
3939
name: "Windows"
4040
runs-on: windows-latest
@@ -44,16 +44,16 @@ jobs:
4444
with:
4545
node-version: 18
4646
cache: 'npm'
47-
- name: Install dependencies
47+
- name: Clean install
4848
run: |
49+
rm -rf node_modules package-lock.json
4950
npm install -g [email protected]
5051
npm ci
51-
- name: Install test dependencies
52+
- name: Install Playwright browsers
5253
run: |
53-
5454
npx playwright install --with-deps chromium firefox webkit
5555
- name: Run tests
56-
run: npx web-test-runner --config web-test-runner.config.cjs
56+
run: npm test
5757
tag:
5858
name: "Publishing release"
5959
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@
4343
"@commitlint/config-conventional": "^18.4.3",
4444
"@open-wc/eslint-config": "^12.0.0",
4545
"@open-wc/testing": "^3.2.0",
46-
"@playwright/test": "^1.40.1",
46+
"@playwright/test": "1.40.1",
4747
"@types/dompurify": "^3.0.5",
4848
"@web/dev-server": "^0.4.1",
49-
"@web/test-runner": "^0.18.0",
50-
"@web/test-runner-playwright": "^0.11.0",
49+
"@web/test-runner": "0.18.0",
50+
"@web/test-runner-playwright": "0.11.0",
5151
"eslint": "^8.55.0",
5252
"eslint-config-prettier": "^9.1.0",
5353
"husky": "^7.0.2",
5454
"lint-staged": "^11.1.2",
55-
"playwright": "^1.40.1",
55+
"playwright": "1.40.1",
5656
"rimraf": "^5.0.5",
5757
"sinon": "^11.1.2",
5858
"typescript": "^4.4.3",
@@ -65,8 +65,8 @@
6565
"lint:types": "tsc",
6666
"lint": "npm run lint:eslint",
6767
"format": "npm run format:eslint",
68-
"test": "web-test-runner test/**/*.test.js --coverage --node-resolve --playwright --browsers chromium firefox webkit",
69-
"test:watch": "web-test-runner test/**/*.test.js --node-resolve --watch --playwright --browsers chromium",
68+
"test": "web-test-runner --config web-test-runner.config.cjs",
69+
"test:watch": "web-test-runner --config web-test-runner.config.cjs --watch",
7070
"gen:wc": "wca analyze \"*.js\" --outFile custom-elements.json",
7171
"prepare": "node demo/model.js"
7272
},

0 commit comments

Comments
 (0)