Commit 820a85c

Anton Golub <antongolub@antongolub.com>
2025-08-02 12:56:15
test: check `fetch()` polyfill for legacy nodejs versions (#1306) tag: 8.8.0
1 parent d2929c4
Changed files (1)
test
test/smoke/node.test.mjs
@@ -90,6 +90,15 @@ import 'zx/globals'
     assert.equal(o.signal, 'SIGTERM')
     assert.throws(() => p.kill(), /Too late to kill the process/)
   }
+
+  // fetch()
+  {
+    const url = 'https://httpbin.org/get'
+    const res = await fetch(url)
+    const json = await res.json()
+    assert.equal(res.status, 200)
+    assert.equal(json.url, url)
+  }
 })()
 
 console.log('smoke mjs: ok')