Skip to content

Commit

Permalink
ci: run vitest on jsdom and happy-dom
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous committed Jan 27, 2024
1 parent 182ecf4 commit 36662a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ jobs:
main:
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
name: Node ${{ matrix.node }}, Svelte ${{ matrix.svelte }}
name: Node ${{ matrix.node }}, Svelte ${{ matrix.svelte }}, ${{ matrix.runner }}
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16', '18', '20']
svelte: ['3', '4']
runs-on: ubuntu-latest
test-runner: ['vitest:jsdom', 'vitest:happy-dom']

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
Expand All @@ -34,8 +36,10 @@ jobs:
npm install --no-package-lock
npm install --no-save svelte@${{ matrix.svelte }}
- name: ▶️ Run validate script
run: npm run validate
- name: ▶️ Run validate scripts
run: |
npm run lint
npm run test:${{ matrix.test-runner }}
- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v3
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@
"test": "vitest run --coverage",
"test:watch": "vitest",
"test:update": "vitest run --update",
"test:vitest:jsdom": "vitest run --coverage --environment jsdom",
"test:vitest:happy-dom": "vitest run --coverage --environment happy-dom",
"setup": "npm install && npm run validate",
"validate": "npm-run-all lint test",
"validate": "npm-run-all lint test:vitest:*",
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate"
},
Expand Down Expand Up @@ -79,6 +81,7 @@
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-svelte": "^2.32.0",
"eslint-plugin-vitest-globals": "^1.3.1",
"happy-dom": "^13.3.1",
"husky": "^8.0.3",
"jsdom": "^22.1.0",
"lint-staged": "^13.2.3",
Expand Down

0 comments on commit 36662a8

Please sign in to comment.