-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjest.setup.cjs
More file actions
54 lines (49 loc) · 1.1 KB
/
Copy pathjest.setup.cjs
File metadata and controls
54 lines (49 loc) · 1.1 KB
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
44
45
46
47
48
49
50
51
52
53
54
jest.mock('simple-git', () => {
const mockGit = {
clone: jest.fn(),
branch: jest.fn(),
getRemotes: jest.fn(),
listRemote: jest.fn(),
env: jest.fn().mockReturnThis(),
revparse: 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', () => ({
constants: jest.requireActual('fs').constants,
existsSync: jest.fn(),
writeFileSync: jest.fn(),
promises: {
writeFile: jest.fn(),
readFile: jest.fn(),
readdir: jest.fn(),
rm: jest.fn(),
mkdir: jest.fn(),
mkdtemp: jest.fn(),
link: jest.fn(),
open: jest.fn(),
rename: jest.fn(),
stat: 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');