Skip to content

Commit 820a85c

Browse files
authored
test: check fetch() polyfill for legacy nodejs versions (#1306)
1 parent d2929c4 commit 820a85c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/smoke/node.test.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ import 'zx/globals'
9090
assert.equal(o.signal, 'SIGTERM')
9191
assert.throws(() => p.kill(), /Too late to kill the process/)
9292
}
93+
94+
// fetch()
95+
{
96+
const url = 'https://httpbin.org/get'
97+
const res = await fetch(url)
98+
const json = await res.json()
99+
assert.equal(res.status, 200)
100+
assert.equal(json.url, url)
101+
}
93102
})()
94103

95104
console.log('smoke mjs: ok')

0 commit comments

Comments
 (0)