Skip to content

Commit a5ebeb6

Browse files
committed
chore: Add test for log
1 parent 48e9542 commit a5ebeb6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/index.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ describe('Uploader Core', () => {
6868
expect(log).toHaveBeenCalledWith(expect.stringMatching(/<<<<<< ENV/))
6969
})
7070

71+
it('Can upload without token', async () => {
72+
jest.spyOn(process, 'exit').mockImplementation(() => {})
73+
const log = jest.spyOn(console, 'log').mockImplementation(() => {})
74+
await app.main({
75+
name: 'customname',
76+
url: 'https://codecov.io',
77+
dryRun: true,
78+
env: 'SOMETHING,ANOTHER',
79+
})
80+
expect(log).toHaveBeenCalledWith(expect.stringMatching('-> No token specified or token is empty'))
81+
})
82+
7183
describe('Flags', () => {
7284
it('can upload with flags', async () => {
7385
process.env.CI = 'true'

0 commit comments

Comments
 (0)