expo-sqlite-mock 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/package.json +1 -1
- package/src/setup.ts +6 -11
package/README.md
CHANGED
|
@@ -14,3 +14,14 @@ Use expo-sqlite with jest.
|
|
|
14
14
|
|
|
15
15
|
1. `npm install -D expo-sqlite-mock` or `bun add -D expo-sqlite-mock`
|
|
16
16
|
2. Add `"setupFilesAfterEnv": ["expo-sqlite-mock/src/setup.ts"]` and `"testTimeout": 10000` to your jest config (It's in `package.json` for default expo project).
|
|
17
|
+
|
|
18
|
+
## Changelog
|
|
19
|
+
|
|
20
|
+
- **2.0.1**
|
|
21
|
+
- Fix setup.
|
|
22
|
+
|
|
23
|
+
- **2.0.0**
|
|
24
|
+
- Update for expo-sqlite ~52.
|
|
25
|
+
|
|
26
|
+
- **1.0.0**
|
|
27
|
+
- Initial version.
|
package/package.json
CHANGED
package/src/setup.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { mockedExpoSqliteNext } from './ExpoSQLiteNext'
|
|
2
|
-
import { existsSync } from 'node:fs'
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return databaseName
|
|
11
|
-
}),
|
|
12
|
-
}))
|
|
13
|
-
}
|
|
3
|
+
jest.mock(`${__dirname}/../../expo-sqlite/build/ExpoSQLite`, () => mockedExpoSqliteNext)
|
|
4
|
+
jest.mock(`${__dirname}/../../expo-sqlite/build/pathUtils`, () => ({
|
|
5
|
+
createDatabasePath: jest.fn().mockImplementation((databaseName: string) => {
|
|
6
|
+
return databaseName
|
|
7
|
+
}),
|
|
8
|
+
}))
|