-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjest.setup.cjs
More file actions
43 lines (38 loc) · 832 Bytes
/
jest.setup.cjs
File metadata and controls
43 lines (38 loc) · 832 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
32
33
34
35
36
37
38
39
40
41
42
43
jest.mock('simple-git', () => {
const mockGit = {
clone: jest.fn(),
branch: jest.fn(),
checkout: jest.fn(),
fetch: jest.fn().mockReturnThis(),
pull: jest.fn(),
init: jest.fn().mockReturnThis(),
addRemote: jest.fn().mockReturnThis(),
tags: jest.fn(() => {
return { latest: '' };
}),
};
const simpleGit = jest.fn(() => mockGit);
return {
__esModule: true,
default: simpleGit,
simpleGit,
};
});
jest.mock('fs', () => ({
existsSync: jest.fn(),
writeFileSync: jest.fn(),
promises: {
writeFile: jest.fn(),
readFile: jest.fn(),
rm: jest.fn(),
mkdir: jest.fn(),
copyFile: jest.fn(),
},
}));
jest.mock('fs-extra', () => ({
copy: jest.fn(),
remove: jest.fn(),
pathExists: jest.fn(),
}));
jest.mock('child_process');
jest.mock('progress');