Open
Description
openedon Aug 2, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment