Skip to content

Commit 3f6d480

Browse files
committed
test: add validation for report-tool input in action tests
Signed-off-by: Sebastian Beltran <[email protected]>
1 parent f769078 commit 3f6d480

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

__tests__/action.test.js

+18
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,22 @@ describe('action', () => {
3131
`Input required and not supplied: ${input}`
3232
)
3333
})
34+
35+
it('should throw an error if the available report is not valid', async () => {
36+
getInputMock.mockImplementation(name => {
37+
if (name === 'report-tool') {
38+
return 'invalid'
39+
}
40+
41+
return ''
42+
})
43+
await main.run()
44+
45+
expect(runMock).toHaveReturned()
46+
expect(setFailedMock).toHaveBeenNthCalledWith(
47+
'The report-tool is not valid, please use: scorecard-visualizer, deps.dev'
48+
)
49+
})
50+
51+
it.todo("should't throw an error if the available report is valid")
3452
})

0 commit comments

Comments
 (0)