-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
jsdomIssue with JSDOM environmentIssue with JSDOM environment
Description
I am trying to introduce react-testing-library in an existent project which has used jasmine/enzyme until now. I am getting a runtime error when I run my tests. It looks like react-testing-library is clashing with other libraries in my project (maybe the existing enzyme). Here are the specs:
react-testing-libraryversion: 5.8.0reactversion: 16.4.1nodeversion: 10.13.0npm(oryarn) version: npm = 6.4.1, yarn = 1.6.0
Relevant code or config:
I cannot reproduce the full code here. Here is the relevant part.
import * as React from 'react';
import { Hierarchy } from './Hierarchy';
import { cleanup, render } from 'react-testing-library';
afterEach(cleanup);
const data = {...}
describe('Hierarchy', () => {
it('should initially render root nodes', () => {
const { getAllByTestId } = render(
<Hierarchy data={data} />
);
expect(getAllByTestId('hierarchy-node').length).toBe(1);
});
});What happened:
I am getting a runtime error when I run tests ( npm run test )
Reproduction:
It is not possible to create a minimum repository to reproduce this issue
This is the first time I am using this library. I might have missed some point.
Thanks for your support
screendriver and sivukhin
Metadata
Metadata
Assignees
Labels
jsdomIssue with JSDOM environmentIssue with JSDOM environment
