mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 02:41:09 +00:00
js client: show error when future spec version is read
This commit is contained in:
BIN
js/test/data/invalid_v4.pmtiles
Normal file
BIN
js/test/data/invalid_v4.pmtiles
Normal file
Binary file not shown.
@@ -192,7 +192,17 @@ test("cache check magic number", async (assertion) => {
|
||||
await cache.getHeader(source);
|
||||
assertion.fail("Should have thrown");
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
assertion.ok(e instanceof Error);
|
||||
}
|
||||
});
|
||||
|
||||
test("cache check future spec version", async (assertion) => {
|
||||
const source = new TestNodeFileSource("test/data/invalid_v4.pmtiles", "1");
|
||||
const cache = new SharedPromiseCache();
|
||||
try {
|
||||
await cache.getHeader(source);
|
||||
assertion.fail("Should have thrown");
|
||||
} catch (e) {
|
||||
assertion.ok(e instanceof Error);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user