We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent decc429 commit 3af8940Copy full SHA for 3af8940
test/builtins/fetch.js
@@ -49,6 +49,18 @@ export async function test(run, testState) {
49
res.end();
50
}).listen(port);
51
52
+ // Wait until the server is ready
53
+ let ready = false;
54
+ const url = FETCH_URL + (port ? ':' + port : '');
55
+ while (!ready) {
56
+ try {
57
+ const res = await fetch(url);
58
+ ready = true;
59
+ } catch (err) {
60
+ await new Promise((resolve) => setTimeout(resolve, 250));
61
+ }
62
63
+
64
const { stdout, stderr } = await run();
65
strictEqual(stderr, '');
66
strictEqual(stdout.trim(), FETCH_URL);
0 commit comments