Skip to content

Commit 0dc492a

Browse files
authored
fix: remove commonjs require from jest/setup for document picker (#916)
* fix: remove commonjs require from jest/setup for document picker * adds changeset
1 parent e91b452 commit 0dc492a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.changeset/sharp-days-sort.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@react-native-documents/picker': patch
3+
---
4+
5+
fix: jest setup warnings from trying to reading commonjs module

packages/document-picker/jest/setup.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ function mockFactory() {
5757
jest.mock('../src/spec/NativeDocumentPicker', () => mockFactory())
5858
// the following are for jest testing outside of the library, where the paths are different
5959
// alternative is to use moduleNameMapper in user space
60-
const mockModulePaths = [
61-
'../../../lib/commonjs/spec/NativeDocumentPicker',
62-
'../../../lib/module/spec/NativeDocumentPicker',
63-
]
60+
const mockModulePaths = ['../../../lib/module/spec/NativeDocumentPicker']
6461
mockModulePaths.forEach((path) => {
6562
try {
6663
require.resolve(path)

0 commit comments

Comments
 (0)