Describe the Bug
Tests do not fail in the terminal when using the --coverage flag because the .nycrc file is not being recognized.
I have an Nx monorepo with a separate app for Storybook. The Storybook configuration and .nycrc configuration file are located in this app.
It works correctly if:
- The
.nycrc file is in the workspace root.
- The current working directory (cwd) is explicitly set to the Storybook app.
However, neither of these approaches fit the desired architecture.
After investigation, it seems that the loadNycConfig function does not receive the .nycrcPath and cwd parameters when creating a report or checking the threshold. These parameters are passed elsewhere but not here.
If you have any questions, please feel free to ask :)
Steps to Reproduce
- Create a monorepo.
- Create an app with Storybook configuration.
- In
.storybook/main.ts, add .nycrcPath to the coverage configuration.
- Run
test-storybook with the --coverage flag.
Expected Behavior
The .nycrc file path should be correctly recognized, and tests should fail if they do not meet the coverage threshold.
Environment
- OS: macOS 14.1
- Node.js version: 20.1
- NPM version: 10.2.3
Describe the Bug
Tests do not fail in the terminal when using the
--coverageflag because the.nycrcfile is not being recognized.I have an Nx monorepo with a separate app for Storybook. The Storybook configuration and
.nycrcconfiguration file are located in this app.It works correctly if:
.nycrcfile is in the workspace root.However, neither of these approaches fit the desired architecture.
After investigation, it seems that the
loadNycConfigfunction does not receive the.nycrcPathandcwdparameters when creating a report or checking the threshold. These parameters are passed elsewhere but not here.If you have any questions, please feel free to ask :)
Steps to Reproduce
.storybook/main.ts, add.nycrcPathto the coverage configuration.test-storybookwith the--coverageflag.Expected Behavior
The
.nycrcfile path should be correctly recognized, and tests should fail if they do not meet the coverage threshold.Environment