Skip to content

Commit eab64c4

Browse files
committed
Expand unit test coverage
1 parent 43bfef4 commit eab64c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1321
-101
lines changed
File renamed without changes.
File renamed without changes.

__fixtures__/@actions/github.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import * as octokit from '../@octokit/rest.js'
2+
3+
export const getOctokit = () => octokit

__fixtures__/@actions/http-client.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 getAgent = jest.fn()
4+
export const getAgentDispatcher = jest.fn()
5+
6+
export class HttpClient {
7+
getAgent = getAgent
8+
getAgentDispatcher = getAgentDispatcher
9+
}

__fixtures__/@octokit/rest.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { jest } from '@jest/globals'
2+
import { Endpoints } from '@octokit/types'
3+
4+
export const graphql = jest.fn()
5+
export const paginate = jest.fn()
6+
export const request = jest.fn()
7+
export const rest = {
8+
actions: {
9+
deleteArtifact:
10+
jest.fn<
11+
() => Endpoints['DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}']['response']
12+
>(),
13+
listWorkflowRunArtifacts:
14+
jest.fn<
15+
() => Endpoints['GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts']['response']
16+
>()
17+
}
18+
}

__fixtures__/fs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const existsSync = jest.fn()
77
export const mkdirSync = jest.fn()
88
export const readFileSync = jest.fn()
99
export const rmSync = jest.fn()
10+
export const statSync = jest.fn()
1011

1112
export default {
1213
accessSync,
@@ -15,5 +16,6 @@ export default {
1516
existsSync,
1617
mkdirSync,
1718
readFileSync,
18-
rmSync
19+
rmSync,
20+
statSync
1921
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ACTIONS_STEP_DEBUG=false
2+
INPUT_MILLISECONDS=2400
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: TypeScript (Success)
2+
description: This action returns without error
3+
4+
inputs:
5+
myInput:
6+
description: An input
7+
required: true
8+
default: value
9+
10+
outputs:
11+
myOutput:
12+
description: An output
13+
14+
runs:
15+
using: node20
16+
main: dist/index.js

__fixtures__/typescript/success-yaml/node_modules/.gitkeep

Whitespace-only changes.

__fixtures__/typescript/success-yaml/package-lock.json

Lines changed: 104 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)