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 — test: use await in test-debugger-invalid-json · nodejs/node@f4f08be

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-debugger-invalid-json.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎…t/parallel/test-debugger-invalid-json.js‎ ‎…/parallel/test-debugger-invalid-json.mjs‎test/parallel/test-debugger-invalid-json.js renamed to test/parallel/test-debugger-invalid-json.mjs test/parallel/test-debugger-invalid-json.js renamed to test/parallel/test-debugger-invalid-json.mjs

Copy file name to clipboard
+18-14Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
'use strict';
2-
const common = require('../common');
3-
const startCLI = require('../common/debugger');
1+
import { skipIfInspectorDisabled, mustCall } from '../common/index.mjs';
42

5-
common.skipIfInspectorDisabled();
3+
skipIfInspectorDisabled();
64

7-
const assert = require('assert');
8-
const http = require('http');
5+
import startCLI from '../common/debugger.js';
6+
7+
import assert from 'assert';
8+
import http from 'http';
99

1010
const host = '127.0.0.1';
1111

@@ -14,14 +14,16 @@ const host = '127.0.0.1';
1414
res.statusCode = 400;
1515
res.end('Bad Request');
1616
});
17-
server.listen(0, common.mustCall(() => {
17+
18+
server.listen(0, mustCall(async () => {
1819
const port = server.address().port;
1920
const cli = startCLI([`${host}:${port}`]);
20-
cli.quit().then(common.mustCall((code) => {
21+
try {
22+
const code = await cli.quit();
2123
assert.strictEqual(code, 1);
22-
})).finally(() => {
24+
} finally {
2325
server.close();
24-
});
26+
}
2527
}));
2628
}
2729

@@ -30,13 +32,15 @@ const host = '127.0.0.1';
3032
res.statusCode = 200;
3133
res.end('some data that is invalid json');
3234
});
33-
server.listen(0, host, common.mustCall(() => {
35+
36+
server.listen(0, host, mustCall(async () => {
3437
const port = server.address().port;
3538
const cli = startCLI([`${host}:${port}`]);
36-
cli.quit().then(common.mustCall((code) => {
39+
try {
40+
const code = await cli.quit();
3741
assert.strictEqual(code, 1);
38-
})).finally(() => {
42+
} finally {
3943
server.close();
40-
});
44+
}
4145
}));
4246
}

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.