-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbun.test.ts
More file actions
31 lines (28 loc) · 759 Bytes
/
bun.test.ts
File metadata and controls
31 lines (28 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Bun test setup - must be run before any tests
import { mock } from 'bun:test';
// Mock react-native before any tests load
mock.module('react-native', () => ({
Animated: {
View: ({ children }: any) => children,
Value: () => {},
},
Image: () => null,
Linking: {
openURL: () => Promise.resolve(),
},
StyleSheet: {
create: (styles: Record<string, any>) => styles,
flatten: (styles: any) => styles,
hairlineWidth: 1,
},
Text: ({ children }: any) => children,
TouchableOpacity: ({ children }: any) => children,
View: ({ children }: any) => children,
}));
// Mock console.error
const originalError = console.error;
console.error = () => {};
// Cleanup
process.on('exit', () => {
console.error = originalError;
});