File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ class Updates {
46
46
const url = `https://api.github.com/repos/${ account } /${ repository } /releases?per_page=100`
47
47
const headers = { Accept : 'application/vnd.github.preview' }
48
48
const res = await fetch ( url , { headers } )
49
+ if ( res . status >= 400 ) return
49
50
const releases = await res . json ( )
50
51
const latest = { }
51
52
for ( const release of releases ) {
Original file line number Diff line number Diff line change @@ -27,8 +27,13 @@ test('Updates', async t => {
27
27
t . ok ( body . name )
28
28
t . match ( body . url , / - m a c \. z i p $ / )
29
29
30
+ // exists but has no releases
30
31
res = await fetch ( `${ address } /juliangruber/brace-expansion/darwin/0.0.0` )
31
32
t . equal ( res . status , 404 )
32
33
34
+ // doesn't exist
35
+ res = await fetch ( `${ address } /doesnot/exist-123123123/darwin/0.0.0` )
36
+ t . equal ( res . status , 404 )
37
+
33
38
server . close ( )
34
39
} )
You can’t perform that action at this time.
0 commit comments