Skip to content

Commit

Permalink
Add test:unit:watch
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Jun 11, 2024
1 parent 461492e commit 18099c4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 41 deletions.
56 changes: 16 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,45 +81,19 @@
},
"typesVersions": {
"*": {
"experimental": [
"./dist/es2017/experimental/index.d.ts"
],
"experimental/features": [
"./dist/es2017/experimental/features/index.d.ts"
],
"experimental/features/embeds": [
"./dist/es2017/__GENERATED_CODE/index.d.ts"
],
"experimental/features/*": [
"./dist/es2017/experimental/features/*.d.ts"
],
"experimental/tools": [
"./dist/es2017/experimental/tools/index.d.ts"
],
"experimental/tools/*": [
"./dist/es2017/experimental/tools/*/index.d.ts"
],
"features": [
"./dist/es2017/features/list/index.d.ts"
],
"features/*": [
"./dist/es2017/features/list/*.d.ts"
],
"logger": [
"./dist/es2017/log.d.ts"
],
"minimal": [
"./dist/es2017/minimal.d.ts"
],
"tools": [
"./dist/es2017/tools/index.d.ts"
],
"tools/*": [
"./dist/es2017/tools/*/index.d.ts"
],
"types": [
"./dist/es2017/public_types.d.ts"
]
"experimental": ["./dist/es2017/experimental/index.d.ts"],
"experimental/features": ["./dist/es2017/experimental/features/index.d.ts"],
"experimental/features/embeds": ["./dist/es2017/__GENERATED_CODE/index.d.ts"],
"experimental/features/*": ["./dist/es2017/experimental/features/*.d.ts"],
"experimental/tools": ["./dist/es2017/experimental/tools/index.d.ts"],
"experimental/tools/*": ["./dist/es2017/experimental/tools/*/index.d.ts"],
"features": ["./dist/es2017/features/list/index.d.ts"],
"features/*": ["./dist/es2017/features/list/*.d.ts"],
"logger": ["./dist/es2017/log.d.ts"],
"minimal": ["./dist/es2017/minimal.d.ts"],
"tools": ["./dist/es2017/tools/index.d.ts"],
"tools/*": ["./dist/es2017/tools/*/index.d.ts"],
"types": ["./dist/es2017/public_types.d.ts"]
}
},
"keywords": [
Expand Down Expand Up @@ -184,6 +158,7 @@
"test:memory": "cross-env BROWSER_CONFIG=chrome vitest run tests/memory",
"test:memory:chrome:watch": "cross-env BROWSER_CONFIG=chrome vitest watch tests/memory",
"test:unit": "vitest --config vitest.config.unit.mjs",
"test:unit:watch": "cross-env WATCH=true vitest --config vitest.config.unit.mjs",
"update-version": "npm run version --git-tag-version=false",
"version": "./scripts/update-version",
"wasm-strip": "node scripts/wasm-strip.mjs dist/mpd-parser.wasm"
Expand Down Expand Up @@ -268,7 +243,8 @@
"test:integration:firefox:watch": "Launch integration tests in Firefox each times the files update"
},
"Unit tests (test particular functions)": {
"test:unit": "Launch unit tests"
"test:unit": "Launch unit tests",
"test:unit:watch": "Launch unit tests and restart them each one of its file changes"
},
"Memory tests (test memory usage to avoid memory leaks)": {
"test:memory": "Launch memory tests",
Expand Down
2 changes: 1 addition & 1 deletion vitest.config.unit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig({
},
},
test: {
watch: false,
watch: process.env.WATCH === "true",
reporters: "dot",
include: ["src/**/*.test.ts", "src/__tests__/**/*.ts"],
environment: "jsdom",
Expand Down

0 comments on commit 18099c4

Please sign in to comment.