File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,9 @@ async function main(args) {
86
86
87
87
// == Step 3: sanitize and set token
88
88
const token = await tokenHelpers . getToken ( inputs , projectRoot )
89
+ if ( token === '' ) {
90
+ log ( '-> No token specified or token is empty' )
91
+ }
89
92
90
93
// == Step 4: get network
91
94
let uploadFile = ''
Original file line number Diff line number Diff line change @@ -68,6 +68,18 @@ describe('Uploader Core', () => {
68
68
expect ( log ) . toHaveBeenCalledWith ( expect . stringMatching ( / < < < < < < E N V / ) )
69
69
} )
70
70
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
+
71
83
describe ( 'Flags' , ( ) => {
72
84
it ( 'can upload with flags' , async ( ) => {
73
85
process . env . CI = 'true'
You can’t perform that action at this time.
0 commit comments