-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: experimental * test: isolate test * ci: restore previous commands * test: attempt to fix flaky
- Loading branch information
1 parent
a7551ce
commit 9fb1f8a
Showing
4 changed files
with
93 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
const { createServer } = require('http') | ||
const { fetch } = require('../..') | ||
|
||
fetch('https://nodejs.org').then( | ||
res => res.body.cancel(), | ||
() => {} | ||
) | ||
const server = createServer((_req, res) => { | ||
res.writeHead(200, { 'Content-Type': 'text/plain' }) | ||
res.end('hello world') | ||
}) | ||
|
||
server.listen(0, () => { | ||
const { port, address, family } = server.address() | ||
const hostname = family === 'IPv6' ? `[${address}]` : address | ||
fetch(`http://${hostname}:${port}`) | ||
.then( | ||
res => res.body.cancel(), | ||
() => {} | ||
) | ||
.then(() => { | ||
server.close() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
const { createServer } = require('http') | ||
const { request } = require('../..') | ||
|
||
request('https://nodejs.org', { maxRedirections: 0 }).then( | ||
res => res.body.dump(), | ||
() => {} | ||
) | ||
const server = createServer((_req, res) => { | ||
res.writeHead(200, { 'Content-Type': 'text/plain' }) | ||
res.end('hello world') | ||
}) | ||
|
||
server.listen(0, () => { | ||
const { port, address, family } = server.address() | ||
const hostname = family === 'IPv6' ? `[${address}]` : address | ||
request(`http://${hostname}:${port}`) | ||
.then(res => res.body.dump()) | ||
.then(() => { | ||
server.close() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters