typescriptreact-nativejestjsreact-native-testing-library

expo app with testing react-native-testing-library and jest-native "has no exported member 'toHaveProp"


I'm trying to use jest-native as extra matchers and i'm having an installation problem i think ...
I am on a react-native ts app with expo and here are my versions:

I would like to use it in this way:

import { toHaveProp } from '@testing-library/jest-native';

expect.extend({ toHaveProp });

But it gives me this error:

Module '"../../../../../../node_modules/@testing-library/jest-native/extend-expect"' has no exported member 'toHaveProp'.

any idea ?


Solution

  • ok if i put it import '@testing-library/jest-native'; on the top of my test file , that works