aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/fetch.js
diff options
context:
space:
mode:
Diffstat (limited to 'integration/bunjs-only-snippets/fetch.js')
-rw-r--r--integration/bunjs-only-snippets/fetch.js23
1 files changed, 13 insertions, 10 deletions
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");
+ }
}