-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.setup.js
More file actions
51 lines (44 loc) · 962 Bytes
/
jest.setup.js
File metadata and controls
51 lines (44 loc) · 962 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
44
45
46
47
48
49
50
51
/**
* @license
* SPDX-License-Identifier: MIT
*
* Copyright (c) 2025 Ryan Johnson
*
* Setup file for Jest tests.
*/
const fetchMock = require('jest-fetch-mock');
fetchMock.enableMocks();
jest.mock('@actions/core', () => ({
getInput: jest.fn(),
setOutput: jest.fn(),
setFailed: jest.fn(),
info: jest.fn(),
debug: jest.fn(),
warning: jest.fn(),
error: jest.fn(),
exportVariable: jest.fn(),
addPath: jest.fn()
}));
jest.mock('@actions/tool-cache', () => ({
downloadTool: jest.fn(),
extractTar: jest.fn(),
extractZip: jest.fn()
}));
jest.mock('@actions/cache', () => ({
saveCache: jest.fn(),
restoreCache: jest.fn()
}));
jest.mock('@actions/exec', () => ({
exec: jest.fn()
}));
// Mock fs
jest.mock('fs', () => ({
existsSync: jest.fn(),
statSync: jest.fn(),
readdirSync: jest.fn(),
chmodSync: jest.fn(),
copyFileSync: jest.fn(),
mkdirSync: jest.fn(),
readFileSync: jest.fn(),
writeFileSync: jest.fn()
}));