add vitest alongside jest (phase 0)

This commit is contained in:
Samuel Newman
2026-06-29 17:44:21 +03:00
parent 2971c3520c
commit dd85eb0b07
5 changed files with 705 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import {vi} from 'vitest'
/*
* The only place `react-native` enters the test module graph is a single
* transitive import in src/lib/media/manip.ts (`import {Image} from
* 'react-native'`). react-native's entry is Flow-typed, which esbuild cannot
* parse, so we stub it. manip.ts only touches RNImage.getSize; Platform is
* included for any other incidental use.
*/
vi.mock('react-native', () => ({
Image: {getSize: vi.fn()},
Platform: {
OS: 'ios',
select: (o: Record<string, unknown>) => o.ios ?? o.default,
},
}))