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

Shallow renderer has been moved to react-test-renderer/shallow #879

Closed
cyanic-webdesign opened this issue Apr 10, 2017 · 3 comments
Closed

Comments

@cyanic-webdesign
Copy link

With the upgrade of React to version 15.5 our unit tests are breaking with the following comment:

Shallow renderer has been moved to react-test-renderer/shallow. Update references to remove this warning

import React from 'react';
import { shallow } from 'enzyme';
import { shallowToJson } from 'enzyme-to-json';

import Component from './Component';

describe('Component', () => {
  it('should render correctly', () => {
    const wrapper = shallow(<Component />);
    expect(shallowToJson(wrapper)).toMatchSnapshot();
  });
});
@ljharb
Copy link
Member

ljharb commented Apr 10, 2017

See #875 / #876. The deprecation warnings affect a lot of tools, so temporarily, you'd need to whitelist that console warning to not fail your tests (or stay on 15.4)

@ljharb ljharb closed this as completed Apr 10, 2017
@erkiesken
Copy link

temporarily, you'd need to whitelist that console warning

How does one do that?

@ljharb
Copy link
Member

ljharb commented Apr 10, 2017

Since console warnings failing tests isn't something standard, you'd find whatever code you wrote to make that happen, and then modify it to ignore this particular error.

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

3 participants