stub async-storage for vitest to fix unhandled window error

This commit is contained in:
Samuel Newman
2026-06-29 18:39:07 +03:00
parent 56b29e21ee
commit 15b4bdc810
2 changed files with 36 additions and 0 deletions
+9
View File
@@ -120,6 +120,15 @@ export default defineConfig({
*/
{find: /^expo$/, replacement: r('./vitest/expo-stub.ts')},
/*
* async-storage references `window` at module load, undefined under
* node. Stubbed with an in-memory implementation.
*/
{
find: /^@react-native-async-storage\/async-storage$/,
replacement: r('./vitest/async-storage-stub.ts'),
},
/*
* Former Jest moduleNameMapper entries. Vite's ESM resolution may make
* some of these unnecessary, but they're harmless and proven, so keep