GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — https: add abortcontroller test · nodejs/node@f44b3c1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-https-abortcontroller.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-https-abortcontroller.js‎

Copy file name to clipboard
+40Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Flags: --experimental-abortcontroller
2+
'use strict';
3+
const common = require('../common');
4+
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
7+
8+
const fixtures = require('../common/fixtures');
9+
const https = require('https');
10+
const assert = require('assert');
11+
const { once } = require('events');
12+
13+
const options = {
14+
key: fixtures.readKey('agent1-key.pem'),
15+
cert: fixtures.readKey('agent1-cert.pem')
16+
};
17+
18+
(async () => {
19+
const { port, server } = await new Promise((resolve) => {
20+
const server = https.createServer(options, () => {});
21+
server.listen(0, () => resolve({ port: server.address().port, server }));
22+
});
23+
try {
24+
const ac = new AbortController();
25+
const req = https.request({
26+
host: 'localhost',
27+
port,
28+
path: '/',
29+
method: 'GET',
30+
rejectUnauthorized: false,
31+
signal: ac.signal,
32+
});
33+
process.nextTick(() => ac.abort());
34+
const [ err ] = await once(req, 'error');
35+
assert.strictEqual(err.name, 'AbortError');
36+
assert.strictEqual(err.code, 'ABORT_ERR');
37+
} finally {
38+
server.close();
39+
}
40+
})().then(common.mustCall());

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.