Skip to content

Commit bb14861

Browse files
committed
Enhance web-test-runner configuration by adding support for multiple browsers (Chromium, Firefox, WebKit) and integrating esbuild for TypeScript support. Update GitHub Actions workflow to include additional global dependencies for improved testing capabilities and ensure all necessary tools are installed before running tests.
1 parent 3eb315c commit bb14861

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/workflows/deployment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install dependencies
3434
run: |
3535
npm install
36-
npm install -g @web/test-runner @web/test-runner-playwright
36+
npm install -g @web/test-runner @web/test-runner-playwright @web/dev-server-esbuild @open-wc/testing
3737
- name: Install Playwright
3838
run: |
3939
npx playwright install
@@ -57,7 +57,7 @@ jobs:
5757
- name: Install dependencies
5858
run: |
5959
npm install
60-
npm install -g @web/test-runner @web/test-runner-playwright
60+
npm install -g @web/test-runner @web/test-runner-playwright @web/dev-server-esbuild @open-wc/testing
6161
- name: Install Playwright
6262
run: |
6363
npx playwright install

web-test-runner.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1+
import { esbuildPlugin } from '@web/dev-server-esbuild';
2+
import { playwrightLauncher } from '@web/test-runner-playwright';
3+
14
export default {
25
files: 'test/**/*.test.js',
36
nodeResolve: true,
7+
browsers: [
8+
playwrightLauncher({ product: 'chromium' }),
9+
playwrightLauncher({ product: 'firefox' }),
10+
playwrightLauncher({ product: 'webkit' }),
11+
],
12+
plugins: [
13+
esbuildPlugin({ ts: true }),
14+
],
415
middleware: [
516
function rewriteBase(context, next) {
617
if (context.url.indexOf('/base') === 0) {
@@ -9,4 +20,9 @@ export default {
920
return next();
1021
}
1122
],
23+
testFramework: {
24+
config: {
25+
timeout: '10000',
26+
},
27+
},
1228
};

0 commit comments

Comments
 (0)