Skip to content

Commit e181a90

Browse files
committed
test: add validation for missing organizations when discovery is enabled
1 parent 7d6efba commit e181a90

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

__tests__/action.test.js

+19
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,23 @@ describe('action', () => {
6666
'Github token is required for push, commit, create an issue and discovery operations!'
6767
)
6868
})
69+
70+
it('should throw an error if discovery is enabled but no organizations are provided', async () => {
71+
getInputMock.mockImplementation(name => {
72+
if (name === 'github-token') {
73+
return 'ghp_obj_obj'
74+
}
75+
if (name === 'discovery-enabled') {
76+
return 'true'
77+
}
78+
79+
return ''
80+
})
81+
await main.run()
82+
83+
expect(runMock).toHaveReturned()
84+
expect(setFailedMock).toHaveBeenNthCalledWith(1,
85+
'Discovery is enabled but no organizations were provided!'
86+
)
87+
})
6988
})

0 commit comments

Comments
 (0)