Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a1fcde0

Browse filesBrowse files
cjihrigrvagg
authored andcommitted
test: simplify test-api-getreport.js
PR-URL: #26169 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent bd40a12 commit a1fcde0
Copy full SHA for a1fcde0

File tree

Expand file treeCollapse file tree

1 file changed

+7
-20
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-20
lines changed
Open diff view settings
Collapse file
+7-20Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
1+
// Flags: --experimental-report
12
'use strict';
2-
3-
// Testcase for returning report as a string via API call
43
const common = require('../common');
54
common.skipIfReportDisabled();
65
const assert = require('assert');
7-
if (process.argv[2] === 'child') {
8-
console.log(process.report.getReport());
9-
} else {
10-
const helper = require('../common/report.js');
11-
const spawnSync = require('child_process').spawnSync;
12-
const tmpdir = require('../common/tmpdir');
13-
tmpdir.refresh();
6+
const helper = require('../common/report');
147

15-
const args = ['--experimental-report', __filename, 'child'];
16-
const child = spawnSync(process.execPath, args, { cwd: tmpdir.path });
17-
const report_msg = 'Found report files';
18-
const std_msg = 'Found messages on stderr';
19-
assert.ok(child.stderr.toString().includes(
20-
`(node:${child.pid}) ExperimentalWarning: report is an` +
21-
' experimental feature. This feature could change at any time'), std_msg);
22-
const reportFiles = helper.findReports(child.pid, tmpdir.path);
23-
assert.deepStrictEqual(reportFiles, [], report_msg);
24-
helper.validateContent(child.stdout);
25-
}
8+
common.expectWarning('ExperimentalWarning',
9+
'report is an experimental feature. This feature could ' +
10+
'change at any time');
11+
helper.validateContent(process.report.getReport());
12+
assert.deepStrictEqual(helper.findReports(process.pid, process.cwd()), []);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.