Skip to content

Commit b27608d

Browse files
authored
Merge pull request #47 from GrantBirki/node-updates
Update Node toolchain
2 parents 4dafcab + 8b8c28d commit b27608d

11 files changed

Lines changed: 28233 additions & 24193 deletions

File tree

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.5.1
1+
24.14.0

__tests__/functions/git-diff.test.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import * as execAsync from '../../src/functions/exec-async'
33
import * as core from '@actions/core'
44
import fs from 'fs'
55

6-
const infoMock = jest.spyOn(core, 'info')
7-
const debugMock = jest.spyOn(core, 'debug')
8-
const setFailedMock = jest.spyOn(core, 'setFailed')
9-
const warningMock = jest.spyOn(core, 'warning')
6+
const infoMock = core.info
7+
const debugMock = core.debug
8+
const setFailedMock = core.setFailed
9+
const warningMock = core.warning
1010

1111
function buildGitArgs(
1212
gitOptions = ['--no-color', '--full-index'],
@@ -23,13 +23,6 @@ function gitArgvDebug(args) {
2323
beforeEach(() => {
2424
jest.clearAllMocks()
2525

26-
jest.spyOn(core, 'saveState').mockImplementation(() => {})
27-
jest.spyOn(core, 'debug').mockImplementation(() => {})
28-
jest.spyOn(core, 'info').mockImplementation(() => {})
29-
jest.spyOn(core, 'setOutput').mockImplementation(() => {})
30-
jest.spyOn(core, 'setFailed').mockImplementation(() => {})
31-
jest.spyOn(core, 'warning').mockImplementation(() => {})
32-
3326
process.env.INPUT_BASE_BRANCH = 'HEAD^1'
3427
process.env.INPUT_SEARCH_PATH = '.'
3528
process.env.INPUT_MAX_BUFFER_SIZE = '1000000'
@@ -237,7 +230,7 @@ test('fails when no custom git diff file is found', async () => {
237230

238231
test('executes gitDiff with file_output_only set to true', async () => {
239232
process.env.INPUT_FILE_OUTPUT_ONLY = 'true'
240-
const setOutputMock = jest.spyOn(core, 'setOutput')
233+
const setOutputMock = core.setOutput
241234

242235
const results = await gitDiff()
243236
expect(results.files.length).toBe(5)
@@ -251,7 +244,7 @@ test('executes gitDiff with file_output_only true and file outputs', async () =>
251244
process.env.INPUT_FILE_OUTPUT_ONLY = 'true'
252245
process.env.INPUT_RAW_DIFF_FILE_OUTPUT = 'test-raw.txt'
253246
process.env.INPUT_JSON_DIFF_FILE_OUTPUT = 'test-json.json'
254-
const setOutputMock = jest.spyOn(core, 'setOutput')
247+
const setOutputMock = core.setOutput
255248

256249
jest.spyOn(fs, 'writeFileSync').mockImplementation(() => {
257250
return true
@@ -845,7 +838,7 @@ test('executes gitDiff with all file outputs and options', async () => {
845838
.mockImplementation(() => {
846839
return true
847840
})
848-
const setOutputSpy = jest.spyOn(core, 'setOutput')
841+
const setOutputSpy = core.setOutput
849842

850843
const results = await gitDiff()
851844
expect(results.files.length).toBe(5)

0 commit comments

Comments
 (0)