Convert to ESM.

Context: https://github.com/actions/typescript-action/pull/969
This commit is contained in:
Fabio Niephaus
2025-09-16 13:20:56 +02:00
committed by Fabio Niephaus
parent 59f089d81e
commit b4c67abb33
35 changed files with 118600 additions and 129021 deletions

7
__fixtures__/cache.ts Normal file
View File

@@ -0,0 +1,7 @@
import * as cache from '@actions/cache'
import { jest } from '@jest/globals'
export const ReserveCacheError = cache.ReserveCacheError
export const restoreCache = jest.fn<typeof cache.restoreCache>()
export const saveCache = jest.fn<typeof cache.saveCache>()
export const ValidationError = cache.ValidationError

13
__fixtures__/core.ts Normal file
View File

@@ -0,0 +1,13 @@
import type * as core from '@actions/core'
import { jest } from '@jest/globals'
export const debug = jest.fn<typeof core.debug>()
export const error = jest.fn<typeof core.error>()
export const exportVariable = jest.fn<typeof core.exportVariable>()
export const getInput = jest.fn<typeof core.getInput>()
export const getState = jest.fn<typeof core.getState>()
export const info = jest.fn<typeof core.info>()
export const saveState = jest.fn<typeof core.saveState>()
export const setFailed = jest.fn<typeof core.setFailed>()
export const setOutput = jest.fn<typeof core.setOutput>()
export const warning = jest.fn<typeof core.warning>()

15
__fixtures__/github.ts Normal file
View File

@@ -0,0 +1,15 @@
import * as github from '@actions/github'
import { jest } from '@jest/globals'
export const context = {
repo: {
owner: 'test-owner',
repo: 'test-repo'
},
sha: 'test-sha',
ref: 'test-ref',
workflow: 'test-workflow',
job: 'test-job',
runId: '12345'
}
export const getOctokit = jest.fn<typeof github.getOctokit>()

4
__fixtures__/glob.ts Normal file
View File

@@ -0,0 +1,4 @@
import * as glob from '@actions/glob'
import { jest } from '@jest/globals'
export const create = jest.fn<typeof glob.create>()