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

[Bug] Code coverage threshold doesn't work in monorepo setup #46

Open
rutsguifd opened this issue Aug 2, 2024 · 0 comments
Open

[Bug] Code coverage threshold doesn't work in monorepo setup #46

rutsguifd opened this issue Aug 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rutsguifd
Copy link

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:

  1. The .nycrc file is in the workspace root.
  2. 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

  1. Create a monorepo.
  2. Create an app with Storybook configuration.
  3. In .storybook/main.ts, add .nycrcPath to the coverage configuration.
  4. 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
@rutsguifd rutsguifd added the bug Something isn't working label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant