diff --git a/tests/utils.ts b/tests/utils.ts index c5f20c1..0721ce3 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -20,7 +20,14 @@ import { DeepPartial } from "lume/core/utils/object.ts"; import { Writer } from "lume/core/writer.ts"; import { fromFileUrl, join } from "@std/path"; -const cwd = fromFileUrl(import.meta.resolve("./")); +const specifier = "./"; +const cwdUrl = await import.meta.resolve?.(specifier); +if (!cwdUrl) { + throw new Error( + `Attempted to resolve ${specifier} but got ${cwdUrl} instead.`, + ); +} +const cwd = fromFileUrl(cwdUrl); class TestWriter implements Writer { savePages() {