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

Coverage fails with collectCoverageFrom using alternate curly braces syntax #6654

Closed
blackholegalaxy opened this issue Jul 7, 2018 · 2 comments

Comments

@blackholegalaxy
Copy link

🐛 Bug Report

Configuring jest collectCoverageFrom with curly braces syntax for file type displays a coverage of 0% with Unknown status.

To Reproduce

In jest.config.js, if we set:

collectCoverageFrom: [
    'src/app/**/*.{ts|js}'
]

also tested with coma (as stated in another closed issue)

collectCoverageFrom: [
    'src/app/**/*.{ts,js}'
]

Please also note, using that kind of syntax:

collectCoverageFrom: [
    'src/app/**/*.{ts}',
]

without alternate, also produces errors.

Run jest:

=============================== Coverage summary ===============================
Statements   : Unknown% ( 0/0 )
Branches     : Unknown% ( 0/0 )
Functions    : Unknown% ( 0/0 )
Lines        : Unknown% ( 0/0 )
================================================================================
----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |        0 |        0 |        0 |        0 |                   |
----------|----------|----------|----------|----------|-------------------|

Expected behavior

We expect the alternate syntax for file type to be allowed.

Additional information

Removing the curly braces and using:

collectCoverageFrom: [
    'src/app/**/*.ts',
    'src/app/**/*.js',
]

displays proper coverage.

Run npx envinfo --preset jest

Paste the results here:

System:
    OS: Windows 10
    CPU: x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
  Binaries:
    Yarn: 1.7.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.1.0 - C:\Program Files\nodejs\npm.CMD
@thymikee
Copy link
Collaborator

thymikee commented Jul 7, 2018

That's issue with our latest migration to micromatch 3. See: #6563

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants