summaryrefslogtreecommitdiff
path: root/cli/tests/unit/fetch_test.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-07-20 16:56:53 +0200
committerGitHub <noreply@github.com>2022-07-20 16:56:53 +0200
commitd17b3906bf3a0871d54e9fdc009891e378dc45f5 (patch)
tree446551bf2f53908d01a4a9b6d35905065369068b /cli/tests/unit/fetch_test.ts
parent73504d76b29eddc1a563e74bb379682e23347b3c (diff)
chore: use import.meta.resolve() in tests (#15256)
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(