Skip to content

Commit

Permalink
Increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisreddington committed Nov 18, 2024
1 parent 75c933c commit 67e9ac5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,16 @@ describe('run', () => {
await run()
expect(core.setFailed).toHaveBeenCalledWith('An unknown error occurred')
})

test('should handle string errors correctly', async () => {
jest.spyOn(core, 'getInput').mockReturnValue('ext1')
;(fs.promises.access as jest.Mock).mockResolvedValue(undefined)
;(fs.promises.readFile as jest.Mock).mockRejectedValue(
'String error message'
)

await run()

expect(core.setFailed).toHaveBeenCalledWith('String error message')
})
})
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 67e9ac5

Please sign in to comment.