11module . exports = {
2- preset : 'ts-jest' ,
3- testEnvironment : 'node' ,
4- roots : [ '<rootDir>/src' ] ,
5- testMatch : [ '**/__tests__/**/*.test.ts' , '**/__tests__/**/*.test.tsx' ] ,
2+ preset : 'react-native' ,
3+ roots : [ '<rootDir>/tests' ] ,
4+ testMatch : [ '**/*.test.ts' , '**/*.test.tsx' ] ,
65 moduleFileExtensions : [ 'ts' , 'tsx' , 'js' , 'jsx' , 'json' ] ,
7- transform : {
8- '^.+\\.(ts|tsx)$' : [
9- 'ts-jest' ,
10- {
11- diagnostics : {
12- ignoreCodes : [ 151002 ] , // Ignore "Could not find a declaration file" warnings
13- } ,
14- } ,
15- ] ,
16- } ,
176 collectCoverageFrom : [
187 'src/**/*.{ts,tsx}' ,
198 '!src/**/*.d.ts' ,
20- '!src/**/__tests__/**' ,
219 '!src/index.ts' ,
2210 ] ,
2311 coverageThreshold : {
@@ -29,15 +17,15 @@ module.exports = {
2917 } ,
3018 } ,
3119 moduleNameMapper : {
32- '^@tetherto/wdk-react-native-secure-storage $' : '<rootDir>/src/__mocks__/secureStorage.ts ' ,
33- '^react$' : '<rootDir>/src /__mocks__/react .ts' ,
20+ '^@src/(.*) $' : '<rootDir>/src/$1 ' ,
21+ '^@tetherto/wdk- react-native-secure-storage $' : '<rootDir>/tests /__mocks__/secureStorage .ts'
3422 } ,
35- setupFilesAfterEnv : [ '<rootDir>/src/__tests__ /setup.ts' ] ,
23+ setupFilesAfterEnv : [ '<rootDir>/tests /setup.ts' ] ,
3624 // Ignore React Native modules if not available
3725 modulePathIgnorePatterns : [ '<rootDir>/node_modules/' ] ,
3826 // Allow tests to run without all dependencies
3927 transformIgnorePatterns : [
40- 'node_modules/(?!(react-native|@react-native|react-native-mmkv|react-native-bare-kit|@tetherto/pear-wrk-wdk)/)' ,
28+ 'node_modules/(?!(react-native|@react-native|react-native-mmkv|react-native-bare-kit|@tetherto/pear-wrk-wdk|immer )/)' ,
4129 ] ,
4230} ;
4331
0 commit comments