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

Part 5c (Testing React apps): jest coverage report does not work with render() of react-testing-library #992

Closed
iFork opened this issue Dec 3, 2020 · 1 comment

Comments

@iFork
Copy link

iFork commented Dec 3, 2020

When I run test with coverage flag I get error about Nothing was returned from render.
Everything is fine without coverage flag.

Some related issues

Attempted Solutions

I attempted following approaches but I always get error

1. Using jest-environment-jsdom-sixteen - npm

CI=true npm test -- --coverage --env=jest-environment-jsdom-sixteen --coverageProvider=v8

But coverageProvider is not listed under cra's supported coverage overrides.

2. Downgrading react-scripts from 3.4.1 to 3.4.0

3. Using ts-jest as jest transformer

install ts-jest.

"jest": {
    "transform": {
      "^.+\\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/ts-jest"
    }
}

Package versions

├── @testing-library/jest-dom@4.2.4
├── @testing-library/react@9.5.0
├── @testing-library/user-event@7.2.1
├── axios@0.19.2
├── jest-environment-jsdom-sixteen@1.0.3
├── json-server@0.16.2
├── prop-types@15.7.2
├── react@16.14.0
├── react-dom@16.14.0
└── react-scripts@3.4.0
iFork added a commit to iFork/fso-exercises that referenced this issue Mar 12, 2021
FIXME: When I run test with coverage flag I get error about `Nothing was
returned from render`.
Attempt different approaches to solve the issue, without luck.
See issue I posted:
[Part 5c (Testing React apps): jest coverage report does not work with render() of react-testing-library · Issue #992 · fullstack-hy2020/fullstack-hy2020.github.io](fullstack-hy2020/fullstack-hy2020.github.io#992)
@mluukkai
Copy link
Contributor

seems to be ok now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants