Skip to content

Commit 44a3118

Browse files
committed
Implement unit tests for cache stub
1 parent 74e603c commit 44a3118

File tree

10 files changed

+759
-1
lines changed

10 files changed

+759
-1
lines changed

__fixtures__/@actions/core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { jest } from '@jest/globals'
33
export const debug = jest.fn().mockImplementation(() => {})
44
export const error = jest.fn().mockImplementation(() => {})
55
export const info = jest.fn().mockImplementation(() => {})
6+
export const isDebug = jest.fn().mockImplementation(() => false)
67
export const getInput = jest.fn().mockImplementation(() => {})
78
export const setOutput = jest.fn().mockImplementation(() => {})
89
export const setFailed = jest.fn().mockImplementation(() => {})

__fixtures__/@actions/io.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { jest } from '@jest/globals'
2+
3+
export const which = jest.fn().mockImplementation(() => {})
4+
export const mkdirP = jest.fn().mockImplementation(() => {})
5+
6+
export default {
7+
which,
8+
mkdirP
9+
}

__fixtures__/fs.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
import { jest } from '@jest/globals'
22

33
export const accessSync = jest.fn()
4+
export const copyFileSync = jest.fn()
45
export const createWriteStream = jest.fn()
56
export const createReadStream = jest.fn()
67
export const existsSync = jest.fn()
78
export const mkdirSync = jest.fn()
9+
export const readdirSync = jest.fn()
810
export const readFileSync = jest.fn()
911
export const rmSync = jest.fn()
1012
export const statSync = jest.fn()
13+
export const writeFileSync = jest.fn()
1114

1215
export default {
1316
accessSync,
17+
copyFileSync,
1418
createWriteStream,
1519
createReadStream,
1620
existsSync,
1721
mkdirSync,
22+
readdirSync,
1823
readFileSync,
1924
rmSync,
20-
statSync
25+
statSync,
26+
writeFileSync
2127
}

0 commit comments

Comments
 (0)