1import test from "node:test";2import { strict as assert } from "node:assert";3import { worldExtentToWGS84 } from "../mint.ts";45test("the whole Web Mercator world becomes the whole bounded Earth", () => {6 const bounds = worldExtentToWGS84([0, -256, 256, 0], {7 sourceZoom: 0, originX: 0, originY: 0, firstTile: 0, tileSize: 256, size: 256,8 });9 assert.deepEqual(bounds, [-180, -85.051128, 180, 85.051128]);10});1112test("a local Atlas window keeps its independent source tile origins", () => {13 const bounds = worldExtentToWGS84([0, -256, 256, 0], {14 sourceZoom: 2, originX: 1, originY: 1, firstTile: 0, tileSize: 256, size: 256,15 });16 assert.deepEqual(bounds, [-90, 0, 0, 66.51326]);17});1819test("a malformed or empty screen rectangle is not authored", () => {20 const grid = { sourceZoom: 2, originX: 1, originY: 1, firstTile: 0, tileSize: 256, size: 256 };21 assert.equal(worldExtentToWGS84([0, 0, 0, 0], grid), null);22 assert.equal(worldExtentToWGS84([NaN, -20, 20, 0], grid), null);23});