testing-library / native-testing-library

🐳 Simple and complete React Native testing utilities that encourage good testing practices.
https://native-testing-library.com
MIT License
516 stars 44 forks source link

Invariant Violation when running through GitKraken #111

Closed tobiaseisenschenk closed 4 years ago

tobiaseisenschenk commented 4 years ago

Relevant code or config:

import { render, waitForElement } from '@testing-library/react-native';
import React from 'react';

const { queryByText } = render(<SomeComponent {...props} />);

What you did:

Execute a pre-push commit hook (husky) through the GitKraken client.

What happened:

● Test suite failed to run

    Invariant Violation: It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling

      at node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5502:9
      at node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5494:3
      at Object.<anonymous> (node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:16:3)
      at Object.<anonymous> (node_modules/react-native/Libraries/Renderer/shims/ReactNative.js:18:17)

Reproduction:

Possible, but I would like to explore the scope and ideas first.

Problem description:

Our githooks fail because of what seems to be a combination of factors. There are related issues at react and huskey, but none of the discussed points could resolve our issue. When executing tests through npm test or even through the githook after git push from the terminal all tests pass. However the only tests failing when running through GitKraken are those using render from this testing library. Therefore I am hoping that above error gives some indication.

luisnomad commented 4 years ago

Still happening... any workaround to fix this? We can't use GitKraken in our project because of this issue...

chrisngabp commented 4 years ago

I'm having the same issue... but locally. Any updates on this?

EDIT: I found that my issue was because I was having NODE_ENV=production in my bash_profile. Maybe this can help.

thymikee commented 4 years ago

FYI, this repository is no longer responsible for this package. See the migration guide to v7.0.