ESM-only with updated @octokit dependencies

This commit is contained in:
Lokesh Gopu
2026-01-27 15:35:32 -05:00
parent ecdfc18bf2
commit b05d26b3fa
12 changed files with 62 additions and 23 deletions
+6 -5
View File
@@ -1,8 +1,6 @@
import * as path from 'path'
import {Context} from '../src/context'
/* eslint-disable @typescript-eslint/no-require-imports */
/* eslint-disable @typescript-eslint/no-var-requires */
import {readFileSync} from 'fs'
import {Context} from '../src/context.js'
describe('@actions/context', () => {
let context: Context
@@ -14,7 +12,10 @@ describe('@actions/context', () => {
})
it('returns the payload object', () => {
expect(context.payload).toEqual(require('./payload.json'))
const payload = JSON.parse(
readFileSync(path.join(__dirname, 'payload.json'), 'utf8')
)
expect(context.payload).toEqual(payload)
})
it('returns an empty payload if the GITHUB_EVENT_PATH environment variable is falsey', () => {