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

Can't run unit tests with Jest #244

Closed
andrekovac opened this issue Aug 17, 2017 · 1 comment
Closed

Can't run unit tests with Jest #244

andrekovac opened this issue Aug 17, 2017 · 1 comment

Comments

@andrekovac
Copy link

While running a most simple unit test I get TypeError: Cannot read property 'IsAndroid' of undefined as in issue #36 . However, building and running the app works perfectly fine.

Mocking react-native-sound via jest.mock('react-native-sound'); doesn't help.

Here's my unit test code:

import 'react-native';
import React from 'react';
import renderer from 'react-test-renderer';

jest.mock('react-native-sound');

import myComponentWithANestedSubComponentWhichUsesRNSound from './';

describe('<ListItemVideo />', () => {

  it('renders correctly', () => {
    const tree = renderer.create(<myComponentWithANestedSubComponentWhichUsesRNSound />);
  });
});

@trepidity
Copy link
Collaborator

duplicate of #245

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

No branches or pull requests

2 participants