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
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

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

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
37 changes: 37 additions & 0 deletions __mocks__/@actions/core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Manual mock for @actions/core used in jest tests
module.exports = {
info: jest.fn(),
debug: jest.fn(),
warning: jest.fn(),
error: jest.fn(),
notice: jest.fn(),
setFailed: jest.fn(),
getInput: jest.fn(),
getBooleanInput: jest.fn(),
setOutput: jest.fn(),
startGroup: jest.fn(),
endGroup: jest.fn(),
group: jest.fn(),
exportVariable: jest.fn(),
setSecret: jest.fn(),
addPath: jest.fn(),
saveState: jest.fn(),
getState: jest.fn(),
isDebug: jest.fn(() => false),
summary: {
addRaw: jest.fn().mockReturnThis(),
addHeading: jest.fn().mockReturnThis(),
addCodeBlock: jest.fn().mockReturnThis(),
addList: jest.fn().mockReturnThis(),
addTable: jest.fn().mockReturnThis(),
addDetails: jest.fn().mockReturnThis(),
addImage: jest.fn().mockReturnThis(),
addSeparator: jest.fn().mockReturnThis(),
addBreak: jest.fn().mockReturnThis(),
addQuote: jest.fn().mockReturnThis(),
addLink: jest.fn().mockReturnThis(),
stringify: jest.fn(() => ''),
write: jest.fn(),
clear: jest.fn()
}
}
17 changes: 17 additions & 0 deletions __mocks__/@actions/github.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Manual mock for @actions/github used in jest tests
module.exports = {
context: {
repo: {owner: 'owner', repo: 'repo'},
sha: 'abc123',
ref: 'refs/heads/main',
payload: {}
},
getOctokit: jest.fn(() => ({
rest: {
checks: {
create: jest.fn(),
update: jest.fn()
}
}
}))
}
7 changes: 7 additions & 0 deletions __mocks__/@actions/glob.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Manual mock for @actions/glob used in jest tests
module.exports = {
create: jest.fn(async () => ({
glob: jest.fn(async () => []),
globGenerator: jest.fn()
}))
}
2 changes: 1 addition & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {annotationsForPath} from '../src/annotations'

beforeAll(() => {
jest.spyOn(fs, 'existsSync').mockReturnValue(true)
process.env['GITHUB_WORKSPACE'] = __dirname
process.env['GITHUB_WORKSPACE'] = path.resolve(__dirname, '..')
})

test('parses file', async () => {
Expand Down
Loading