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
Some passing tests will fail when using --coverage flag #2261
Comments
@DmitriiAbramov any ideas on why is this happening? |
Adding
@nsand: For example, your import React from 'react';
const Icon = ({ name }) => (
<i className={`fa-icon fa-icon--${name}`}></i>
);
Icon.displayName = 'Icon';
export default Icon; |
@rogeliog Amazing! Thank you. I was doing some debugging a bit ago and had noticed if I called npm test
vs
Where the difference is that Function is named for |
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. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Executing
npm test
has all tests passing; however, executingnpm test -- --coverage
causes some tests to fail.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal repository on GitHub that we can
npm install
andnpm test
.I have a project containing a number of react components that I'm testing using jest and enzyme. I recently moved us up from
jest@15.1.1
tojest@17.0.3
andbabel-jest@14.1.0
tobabel-jest@17.0.2
. I cleaned out thenode_modules
directory before installing the newer versions.I run
npm test
and all of the tests pass. When I runnpm test -- --coverage
, some tests fail and the coverage report is generated.It seems like all of the failures are around a component being shallow rendered with enzyme and then using
find(selector)
to find nodes in the render tree. The nodes are successfully found duringjest
, but fail forjest --coverage
.Before the upgrade, all tests passed for
jest
andjest --coverage
.Repo: https://github.com/nsand/jest-coverage
What is the expected behavior?
I would expect that all of the tests pass for both executions.
Run Jest again with
--debug
and provide the full configuration it prints. Please mention your node and npm version and operating system.node @ v6.9.1
npm @3.10.8
OS macOS Sierra
The text was updated successfully, but these errors were encountered: