summaryrefslogtreecommitdiff
path: root/cli/tests/unit/fetch_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/fetch_test.ts')
-rw-r--r--cli/tests/unit/fetch_test.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts
index 72660c547..6408d06d3 100644
--- a/cli/tests/unit/fetch_test.ts
+++ b/cli/tests/unit/fetch_test.ts
@@ -1464,7 +1464,7 @@ Deno.test(
Deno.test({ permissions: { read: false } }, async function fetchFilePerm() {
await assertRejects(async () => {
- await fetch(new URL("../testdata/subdir/json_1.json", import.meta.url));
+ await fetch(import.meta.resolve("../testdata/subdir/json_1.json"));
}, Deno.errors.PermissionDenied);
});
@@ -1472,7 +1472,7 @@ Deno.test(
{ permissions: { read: false } },
async function fetchFilePermDoesNotExist() {
await assertRejects(async () => {
- await fetch(new URL("./bad.json", import.meta.url));
+ await fetch(import.meta.resolve("./bad.json"));
}, Deno.errors.PermissionDenied);
},
);
@@ -1483,7 +1483,7 @@ Deno.test(
await assertRejects(
async () => {
await fetch(
- new URL("../testdata/subdir/json_1.json", import.meta.url),
+ import.meta.resolve("../testdata/subdir/json_1.json"),
{
method: "POST",
},
@@ -1500,7 +1500,7 @@ Deno.test(
async function fetchFileDoesNotExist() {
await assertRejects(
async () => {
- await fetch(new URL("./bad.json", import.meta.url));
+ await fetch(import.meta.resolve("./bad.json"));
},
TypeError,
);
@@ -1511,7 +1511,7 @@ Deno.test(
{ permissions: { read: true } },
async function fetchFile() {
const res = await fetch(
- new URL("../testdata/subdir/json_1.json", import.meta.url),
+ import.meta.resolve("../testdata/subdir/json_1.json"),
);
assert(res.ok);
const fixture = await Deno.readTextFile(