Skip to content

Commit c53631f

Browse files
committed
fix(mock): provided mock fails to load
1 parent a9b606b commit c53631f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

jest/react-native-file-access.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import type {
77
FileStat,
88
FsStat,
99
HashAlgorithm,
10-
Util as UtilFunctions,
1110
} from 'react-native-file-access';
1211

13-
export const Util: typeof UtilFunctions =
14-
require('react-native-file-access/lib/commonjs/util').Util;
12+
export { Util } from 'react-native-file-access/util';
1513

1614
export const Dirs = {
1715
CacheDir: '/mock/CacheDir',

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"types": "./lib/typescript/src/index.d.ts",
1111
"default": "./lib/module/index.js"
1212
},
13+
"./util": {
14+
"source": "./src/util.ts",
15+
"types": "./lib/typescript/src/util.d.ts",
16+
"default": "./lib/module/util.js"
17+
},
1318
"./package.json": "./package.json"
1419
},
1520
"files": [

0 commit comments

Comments
 (0)