Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.5.1
24.14.0
21 changes: 7 additions & 14 deletions __tests__/functions/git-diff.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import * as execAsync from '../../src/functions/exec-async'
import * as core from '@actions/core'
import fs from 'fs'

const infoMock = jest.spyOn(core, 'info')
const debugMock = jest.spyOn(core, 'debug')
const setFailedMock = jest.spyOn(core, 'setFailed')
const warningMock = jest.spyOn(core, 'warning')
const infoMock = core.info
const debugMock = core.debug
const setFailedMock = core.setFailed
const warningMock = core.warning

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

jest.spyOn(core, 'saveState').mockImplementation(() => {})
jest.spyOn(core, 'debug').mockImplementation(() => {})
jest.spyOn(core, 'info').mockImplementation(() => {})
jest.spyOn(core, 'setOutput').mockImplementation(() => {})
jest.spyOn(core, 'setFailed').mockImplementation(() => {})
jest.spyOn(core, 'warning').mockImplementation(() => {})

process.env.INPUT_BASE_BRANCH = 'HEAD^1'
process.env.INPUT_SEARCH_PATH = '.'
process.env.INPUT_MAX_BUFFER_SIZE = '1000000'
Expand Down Expand Up @@ -237,7 +230,7 @@ test('fails when no custom git diff file is found', async () => {

test('executes gitDiff with file_output_only set to true', async () => {
process.env.INPUT_FILE_OUTPUT_ONLY = 'true'
const setOutputMock = jest.spyOn(core, 'setOutput')
const setOutputMock = core.setOutput

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

jest.spyOn(fs, 'writeFileSync').mockImplementation(() => {
return true
Expand Down Expand Up @@ -845,7 +838,7 @@ test('executes gitDiff with all file outputs and options', async () => {
.mockImplementation(() => {
return true
})
const setOutputSpy = jest.spyOn(core, 'setOutput')
const setOutputSpy = core.setOutput

const results = await gitDiff()
expect(results.files.length).toBe(5)
Expand Down
Loading
Loading