Skip to content

Commit e26764f

Browse files
committed
add passing 204 No Content test (cov 92%)
1 parent 423511c commit e26764f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,23 @@ test('Updates', async t => {
2121
let res = await fetch(`${address}/`)
2222
t.equal(res.status, 404)
2323

24+
// exists and has update
2425
res = await fetch(`${address}/dat-land/dat-desktop/darwin/1.0.0`)
2526
t.equal(res.status, 200)
2627
const body = await res.json()
2728
t.ok(body.name)
2829
t.match(body.url, /-mac\.zip$/)
2930

31+
// exists but no updates
32+
res = await fetch(
33+
`https://api.github.com/repos/dat-land/dat-desktop/releases?per_page=1`
34+
)
35+
const releases = await res.json()
36+
res = await fetch(
37+
`${address}/dat-land/dat-desktop/darwin/${releases[0].name}`
38+
)
39+
t.equal(res.status, 204)
40+
3041
// exists but has no releases
3142
res = await fetch(`${address}/juliangruber/brace-expansion/darwin/0.0.0`)
3243
t.equal(res.status, 404)

0 commit comments

Comments
 (0)