-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.setup.js
More file actions
30 lines (26 loc) · 640 Bytes
/
jest.setup.js
File metadata and controls
30 lines (26 loc) · 640 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
/**
* @license
* SPDX-License-Identifier: MIT
*
* Copyright (c) 2025 Ryan Johnson
*
* Setup file for Jest tests.
*/
const fetchMock = require('jest-fetch-mock');
fetchMock.enableMocks();
// Enable mocks for @actions packages (implementations in __mocks__ directory)
jest.mock('@actions/core');
jest.mock('@actions/tool-cache');
jest.mock('@actions/cache');
jest.mock('@actions/exec');
// 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()
}));