From aa5882a1c3e40d238f9ef746dad665809bdee4aa Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 21 Feb 2024 13:58:12 +0100 Subject: [PATCH] add test for non js modules --- test/fixture/{hello-linked.mjs => hello.link.mjs} | 0 test/fixture/test.link.txt | 1 + test/fixture/test.txt | 1 + test/resolve.test.ts | 7 ++++++- 4 files changed, 8 insertions(+), 1 deletion(-) rename test/fixture/{hello-linked.mjs => hello.link.mjs} (100%) create mode 120000 test/fixture/test.link.txt create mode 100644 test/fixture/test.txt diff --git a/test/fixture/hello-linked.mjs b/test/fixture/hello.link.mjs similarity index 100% rename from test/fixture/hello-linked.mjs rename to test/fixture/hello.link.mjs diff --git a/test/fixture/test.link.txt b/test/fixture/test.link.txt new file mode 120000 index 0000000..541cb64 --- /dev/null +++ b/test/fixture/test.link.txt @@ -0,0 +1 @@ +test.txt \ No newline at end of file diff --git a/test/fixture/test.txt b/test/fixture/test.txt new file mode 100644 index 0000000..524acff --- /dev/null +++ b/test/fixture/test.txt @@ -0,0 +1 @@ +Test file diff --git a/test/resolve.test.ts b/test/resolve.test.ts index d5d28fe..c1a2d50 100644 --- a/test/resolve.test.ts +++ b/test/resolve.test.ts @@ -38,10 +38,15 @@ describe("resolveSync", () => { } it("follows symlinks", () => { - const resolved = resolveSync("./fixture/hello-linked", { + const resolved = resolveSync("./fixture/hello.link", { url: import.meta.url, }); expect(fileURLToPath(resolved)).match(/fixture\/hello\.mjs$/); + + const resolved2 = resolveSync("./fixture/test.link.txt", { + url: import.meta.url, + }); + expect(fileURLToPath(resolved2)).match(/fixture\/test.txt$/); }); });