react-native-qrcode-reader icon indicating copy to clipboard operation
react-native-qrcode-reader copied to clipboard

TypeError: Cannot read property 'Aspect' of undefined

Open ashokseervidev opened this issue 7 years ago • 2 comments

I am writing unit test cases for my project using jest.

when i run npm test i am getting below error.

● Test suite failed to run

    TypeError: Cannot read property 'Aspect' of undefined
      
      at Object.<anonymous> (node_modules/react-native-qrcode-scanner/node_modules/react-native-camera/index.js:254:78)
      at Object.<anonymous> (node_modules/react-native-qrcode-scanner/index.js:17:24)

below is my code.

import React from 'react';
import TestUtils from 'react-addons-test-utils';
import {Item} from '../Item';

test('works', () => {
  expect(true).toBe(true)
})

react-native --version react-native-cli: 2.0.1 react-native: 0.40.0

package.json "react-native-qrcode-scanner": "0.0.8",

ashokseervidev avatar Apr 26 '17 03:04 ashokseervidev

The link of react-native-camera is incorrect.

rijn avatar Mar 23 '18 01:03 rijn

Add this jest.mock('react-native-qrcode-scanner', () => jest.fn());

imranMnts avatar Jun 20 '18 12:06 imranMnts