cloudflare worker supports PMTILES_PATH

This commit is contained in:
Brandon Liu
2022-07-21 15:30:53 +08:00
parent d482611910
commit fc5e366bd2
2 changed files with 30 additions and 7 deletions

View File

@@ -1,5 +1,17 @@
import { test } from "zora";
import { pmtiles_path } from "./worker";
test("stub test", (assertion) => {
assertion.ok(true);
test("pmtiles path", (assertion) => {
let result = pmtiles_path(undefined, "foo");
assertion.equal(result, "foo.pmtiles");
});
test("pmtiles path", (assertion) => {
let result = pmtiles_path("folder/{name}/file.pmtiles", "foo");
assertion.equal(result, "folder/foo/file.pmtiles");
});
test("pmtiles path with slash", (assertion) => {
let result = pmtiles_path("folder/{name}/file.pmtiles", "foo/bar");
assertion.equal(result, "folder/foo/bar/file.pmtiles");
});