Code coverage for link/unlink endpoints

This commit is contained in:
Cadence Ember
2025-02-07 16:45:47 +13:00
parent a29d019d17
commit a90d3b9055
13 changed files with 802 additions and 67 deletions

View File

@@ -2,6 +2,7 @@
const {test} = require("supertape")
const {router} = require("../../test/web")
const assert = require("assert").strict
require("./server")
@@ -28,5 +29,8 @@ test("web server: compresses static resources", async t => {
"accept-encoding": "gzip"
}
})
t.ok(content instanceof ReadableStream)
assert(content instanceof ReadableStream)
const firstChunk = await content.getReader().read()
t.ok(firstChunk.value instanceof Uint8Array, "can get data")
t.deepEqual(firstChunk.value.slice(0, 3), Uint8Array.from([31, 139, 8]), "has compressed gzip header")
})