Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run vitest on jsdom and happy-dom #297

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 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.test-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 @@ -35,7 +37,7 @@ jobs:
npm install --no-save svelte@${{ matrix.svelte }}

- name: ▶️ Run validate script
run: npm run validate
run: 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 @@ -55,8 +55,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 test",
"validate": "npm-run-all test:vitest:*",
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate"
},
Expand Down Expand Up @@ -84,6 +86,7 @@
"eslint-plugin-simple-import-sort": "10.0.0",
"eslint-plugin-svelte": "2.35.1",
"eslint-plugin-vitest-globals": "1.4.0",
"happy-dom": "^13.3.1",
"jsdom": "^22.1.0",
"npm-run-all": "^4.1.5",
"prettier": "3.2.4",
Expand Down
Loading