Skip to content

Commit 69413ac

Browse files
authoredNov 7, 2024··
chore: fix test config (#108)
1 parent 20c9be2 commit 69413ac

File tree

7 files changed

+642
-210
lines changed

7 files changed

+642
-210
lines changed
 

‎.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030
run: yarn playwright install --with-deps
3131

3232
- name: Run Tests
33-
run: yarn test --browser.name=${{ env.BROWSER }} --browser.headless
33+
run: yarn testonly --browser.name=${{ env.BROWSER }} --browser.headless --coverage
3434
env:
3535
BROWSER: ${{ matrix.browser }}
3636

3737
- name: Codecov
38-
uses: codecov/codecov-action@v1
38+
uses: codecov/codecov-action@v4
3939

4040
- name: Build Project
4141
run: yarn build

‎package.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"start": "yarn --cwd www start",
5959
"tdd": "vitest",
6060
"test": "yarn lint && yarn testonly",
61-
"testonly": "yarn vitest --run"
61+
"testonly": "vitest --run"
6262
},
6363
"lint-staged": {
6464
"*.js,*.tsx": "eslint --fix --ext .js,.ts,.tsx"
@@ -108,8 +108,9 @@
108108
"@types/react-transition-group": "^4.4.4",
109109
"@typescript-eslint/eslint-plugin": "^4.33.0",
110110
"@typescript-eslint/parser": "^4.33.0",
111-
"@vitejs/plugin-react": "^4.3.1",
112-
"@vitest/browser": "^2.0.2",
111+
"@vitejs/plugin-react": "^4.3.2",
112+
"@vitest/browser": "^2.1.3",
113+
"@vitest/coverage-istanbul": "2.1.3",
113114
"babel-eslint": "^10.1.0",
114115
"babel-plugin-istanbul": "^6.1.1",
115116
"babel-preset-env-modules": "^1.0.1",
@@ -126,17 +127,18 @@
126127
"gh-pages": "^3.1.0",
127128
"hookem": "^1.0.9",
128129
"lint-staged": "^10.5.4",
129-
"playwright": "^1.45.1",
130+
"playwright": "^1.48.0",
130131
"prettier": "^2.7.1",
131132
"react": "^18.3.1",
132133
"react-dom": "^18.3.1",
133134
"react-transition-group": "^4.4.1",
134135
"rimraf": "^3.0.2",
135136
"rollup": "^4.18.1",
136137
"typescript": "^4.7.4",
137-
"vitest": "^2.0.2"
138+
"vitest": "^2.1.3"
138139
},
139140
"bugs": {
140141
"url": "https://github.com/react-restart/ui/issues"
141-
}
142+
},
143+
"packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
142144
}

‎test/ambient.d.ts

Whitespace-only changes.

‎vitest-example/HelloWorld.test.tsx

-9
This file was deleted.

‎vitest-example/HelloWorld.tsx

-7
This file was deleted.

‎vitest.config.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from 'vitest/config';
1+
import { coverageConfigDefaults, defineConfig } from 'vitest/config';
22
import react from '@vitejs/plugin-react';
33

44
export default defineConfig({
@@ -13,5 +13,9 @@ export default defineConfig({
1313
// https://playwright.dev
1414
providerOptions: {},
1515
},
16+
coverage: {
17+
provider: 'istanbul',
18+
exclude: [...coverageConfigDefaults.exclude, 'www/**', '**/*.js'],
19+
},
1620
},
1721
});

0 commit comments

Comments
 (0)
Please sign in to comment.