From 9322cec8f261dda20a2a6cc6fe7aa887c4dfeeb9 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Wed, 26 Jan 2022 14:37:44 -0800 Subject: WIP --- integration/bunjs-only-snippets/fetch.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'integration/bunjs-only-snippets/fetch.js') diff --git a/integration/bunjs-only-snippets/fetch.js b/integration/bunjs-only-snippets/fetch.js index cc83b5af4..bb4345659 100644 --- a/integration/bunjs-only-snippets/fetch.js +++ b/integration/bunjs-only-snippets/fetch.js @@ -1,14 +1,17 @@ import fs from "fs"; -const response = await fetch("http://example.com/"); -const text = await response.text(); +const urls = ["https://example.com", "http://example.com"]; +for (let url of urls) { + const response = await fetch(url); + const text = await response.text(); -if ( - fs.readFileSync( - import.meta.path.substring(0, import.meta.path.lastIndexOf("/")) + - "/fetch.js.txt", - "utf8" - ) !== text -) { - throw new Error("Expected fetch.js.txt to match snapshot"); + if ( + fs.readFileSync( + import.meta.path.substring(0, import.meta.path.lastIndexOf("/")) + + "/fetch.js.txt", + "utf8" + ) !== text + ) { + throw new Error("Expected fetch.js.txt to match snapshot"); + } } -- cgit v1.2.3