-
-
Couldn't load subscription status.
- Fork 27.1k
Closed
jestjs/jest
#1754Milestone
Description
Steps:
- Create a new app:
create-react-app my-app - Create a new file that does a
jest.mock(), ex:
src/mock.js
jest.mock('react-dom', () => {})- Import this file in App.test.js:
src/App.test.js
import './mock.js'
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
...- Run the tests with
--coverage:
npm run test -- --coverage
I can't find a workaround for this, there's no documentation on how to import mocks so I can reuse them.
@cpojer It may be a Jest issue ? Am I doing something wrong ?
