Skip to content

Commit 7617f70

Browse files
stop using mockfetch in favor of std
1 parent 2e85948 commit 7617f70

File tree

11 files changed

+351
-799
lines changed

11 files changed

+351
-799
lines changed

scripts/src/import_map/update_test.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ const depsTsMock =
88
export type {SlackAPIClient, Trigger} from "https://deno.land/x/deno_slack_api@2.2.0/types.ts";`;
99

1010
Deno.test("apiDepsIn should return a list of the api module urls used by a module", async () => {
11-
using _fetchStub = stubFetch(new Response(depsTsMock), {
12-
url: "https://deno.land/x/deno_slack_sdk@x.x.x/deps.ts?source,file",
11+
using _fetchStub = stubFetch(new Response(depsTsMock), (req) => {
12+
assertEquals(
13+
req.url,
14+
"https://deno.land/x/deno_slack_sdk@x.x.x/deps.ts?source,file",
15+
);
1316
});
1417

1518
const apiDeps = await apiDepsIn(
@@ -26,9 +29,12 @@ Deno.test("apiDepsIn should return a list of the api module urls used by a modul
2629
});
2730

2831
Deno.test("apiDepsIn should throw http error on response not ok", async () => {
29-
using _fetchStub = stubFetch(new Response("error", { status: 500 }), {
30-
url: "https://deno.land/x/deno_slack_sdk@x.x.x/deps.ts",
31-
});
32+
using _fetchStub = stubFetch(
33+
new Response("error", { status: 500 }),
34+
(req) => {
35+
assertEquals(req.url, "https://deno.land/x/deno_slack_sdk@x.x.x/deps.ts");
36+
},
37+
);
3238

3339
const error = await assertRejects(() =>
3440
apiDepsIn("https://deno.land/x/deno_slack_sdk@x.x.x/")

0 commit comments

Comments
 (0)