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

[test] Enable test coverage for @toolpad/core #3697

Merged
merged 7 commits into from
Jun 21, 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
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version: 2.1
orbs:
codecov: codecov/[email protected]

default-job: &default-job
working_directory: /tmp/mui-toolpad
Expand Down Expand Up @@ -164,6 +166,7 @@ jobs:
- run:
name: Tests fake browser
command: pnpm test
- codecov/upload

test_unit_browser:
<<: *default-job
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ test-results
.github/styles/Google
.github/styles/MUI
.github/styles/.vale-config

.coverage
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
target: auto
threshold: 1%
patch: off
comment: false
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"@types/yargs": "17.0.32",
"@typescript-eslint/eslint-plugin": "7.12.0",
"@typescript-eslint/parser": "7.12.0",
"@vitest/coverage-v8": "beta",
"babel-plugin-react-remove-properties": "0.3.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"chalk": "5.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/toolpad-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"prebuild": "rimraf build tsconfig.build.tsbuildinfo",
"dev": "concurrently \"pnpm build:stable --watch\" \"pnpm build:types --watch --preserveWatchOutput\"",
"check-types": "tsc --noEmit",
"test": "vitest run",
"test": "vitest run --coverage",
"test:dev": "vitest",
"test:browser": "vitest run --browser.enabled",
"test:browser:dev": "vitest --browser.enabled"
Expand Down
5 changes: 5 additions & 0 deletions packages/toolpad-core/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ export default defineConfig({
provider: 'playwright',
headless: !!process.env.CI,
},
coverage: {
exclude: ['./build/**'],
reportsDirectory: './.coverage',
reporter: ['text', 'lcov'],
},
},
});
2 changes: 1 addition & 1 deletion packages/toolpad-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"build": "tsup",
"dev": "tsup --watch",
"check-types": "tsup && tsc --noEmit",
"test": "vitest run"
"test": "vitest run --coverage"
},
"bugs": {
"url": "https://github.com/mui/mui-toolpad/issues"
Expand Down
5 changes: 5 additions & 0 deletions packages/toolpad-utils/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
setupFiles: ['../../test/setupVitest.ts'],
coverage: {
exclude: ['./dist/**'],
reportsDirectory: './.coverage',
reporter: ['text', 'lcov'],
},
},
});
Loading
Loading