forked from Rapsssito/react-native-tcp-socket
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
25 lines (24 loc) · 678 Bytes
/
jest.setup.js
File metadata and controls
25 lines (24 loc) · 678 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
jest.mock('react-native', () => {
// Mock NativeEventEmitter
class NativeEventEmitter {
constructor() {
this.addListener = jest.fn(() => ({ remove: () => {} }));
}
}
return {
NativeModules: {
TcpSockets: {
connect: jest.fn(),
end: jest.fn(),
destroy: jest.fn(),
write: jest.fn(),
listen: jest.fn(),
pause: jest.fn(),
resume: jest.fn(),
setKeepAlive: jest.fn(),
setNoDelay: jest.fn(),
},
},
NativeEventEmitter: NativeEventEmitter,
};
});