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.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/integration/bunjs-only-snippets/fetch.js b/integration/bunjs-only-snippets/fetch.js
new file mode 100644
index 000000000..cc83b5af4
--- /dev/null
+++ b/integration/bunjs-only-snippets/fetch.js
@@ -0,0 +1,14 @@
+import fs from "fs";
+
+const response = await fetch("http://example.com/");
+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");
+}