Created
September 28, 2023 18:51
-
-
Save jaredcwhite/3949cf215e0ac5e552652170c34405f7 to your computer and use it in GitHub Desktop.
Setting up web-test-runner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/ci.yml | |
name: CI Test | |
on: | |
pull_request: | |
branches: | |
- "*" | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: Install packages | |
run: npm ci | |
- name: Set up Playwright | |
run: npx playwright install --with-deps | |
- name: Run tests | |
run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"test": "web-test-runner --node-resolve", | |
"test:dev": "npm run test -- --watch" | |
}, | |
"devDependencies": { | |
"@open-wc/testing": "^3.2.0", | |
"@web/test-runner": "^0.17.1", | |
"@web/test-runner-playwright": "^0.10.1", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { playwrightLauncher } from "@web/test-runner-playwright" | |
export default { | |
browsers: [ | |
playwrightLauncher({ product: "chromium" }), | |
playwrightLauncher({ product: "firefox" }), | |
playwrightLauncher({ product: "webkit" }), | |
], | |
files: "test/**/*.test.js", | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment