Skip to content

Commit ba78f7d

Browse files
authored
Switch to web-test-runner (#214)
* Switch to web-test-runner Reusing some of what I went through with the addons testing work, I tried to use web-test-runner here as well. Even though we aren't using web components here yet, this pattern still works quite nicely for testing some complex browser integration style tests. This uses WTR, Rollup for bundling for tests, and I've created two test cases: I translated old tests to Chai/WTR, and a new test that mixes HTML and JS, using WTR HTML tests. * Remove unneeded hack * Update CI config * More CI config * Some cleanup and formatting
1 parent 0904780 commit ba78f7d

File tree

13 files changed

+5539
-214
lines changed

13 files changed

+5539
-214
lines changed

.circleci/config.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
version: 2.1
22

3+
orbs:
4+
browser-tools: circleci/[email protected]
5+
36
commands:
47
run-lint:
5-
description: "Run code tests and linter"
8+
description: "Run code linter"
69
steps:
710
- checkout
811
- run: npm ci
9-
- run: npm test
1012
- run: npm run lint
1113
run-build:
1214
description: "Ensure built assets are up to date"
@@ -23,6 +25,14 @@ commands:
2325
git status readthedocsext/ --porcelain
2426
exit 1
2527
fi
28+
run-test:
29+
description: "Run test suite"
30+
steps:
31+
- browser-tools/install-chrome
32+
- browser-tools/install-chromedriver
33+
- checkout
34+
- run: npm ci
35+
- run: npm test
2636

2737
jobs:
2838
lint:
@@ -35,10 +45,16 @@ jobs:
3545
- image: "cimg/node:16.14"
3646
steps:
3747
- run-build: {}
48+
test:
49+
docker:
50+
- image: "cimg/node:16.14"
51+
steps:
52+
- run-test: {}
3853

3954
workflows:
4055
version: 2
4156
tests:
4257
jobs:
4358
- lint
4459
- build
60+
- test

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Don't do templates at all. Prettier is opinionated and there is extra Django
22
# pieces that would be mangled by Prettier.
33
*.html
4+
!/src/js/tests/**/*.html
45
/docs/_build/
56
/docs/out/
67
/build/

0 commit comments

Comments
 (0)