fix: fix storybook coverage task (#5256)

- Fixes storybook coverage command: the coverage directory path was
incorrect, but instead of failing `storybook:test --configuration=ci`,
it was hanging indefinitely.
- Switches back to `concurrently` to launch `storybook:static` and
`storybook:test` in parallel, which allows to use options to explicitly
kill `storybook:static` when `storybook:test` fails.
- Moves `storybook:test --configuration=ci` to its own command
`storybook:static:test`: used in the CI, and can be used locally to run
storybook tests without having to launch `storybook:dev` first.
- Creates command `storybook:coverage` and enables cache for this
command.
- Fixes Jest tests that were failing.
- Improves caching conditions for some tasks (for instance, no need to
invalidate Jest test cache if only Storybook story files were modified).
This commit is contained in:
Thaïs
2024-05-03 14:59:09 +02:00
committed by GitHub
parent 50421863d4
commit 1351a95754
11 changed files with 123 additions and 75 deletions

View File

@ -11,11 +11,7 @@
"generateBarrels": {
"executor": "nx:run-commands",
"cache": true,
"inputs": [
"{projectRoot}/src/**/*.{ts,tsx}",
"!{projectRoot}/src/**/*.(spec|test).{ts,tsx}",
"!{projectRoot}/src/**/*.stories.{ts,tsx}"
],
"inputs": ["production", "{projectRoot}/scripts/generateBarrels.js"],
"outputs": ["{projectRoot}/src/index.ts", "{projectRoot}/src/*/index.ts"],
"options": {
"command": "node {projectRoot}/scripts/generateBarrels.js"
@ -52,10 +48,12 @@
"port": 6007
}
},
"storybook:coverage": {},
"storybook:test": {
"options": {
"url": "http://localhost:6007"
}
"options": { "port": 6007 }
},
"storybook:static:test": {
"options": { "port": 6007 }
}
}
}