diff options
author | cjihrig <cjihrig@gmail.com> | 2019-03-08 11:59:08 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-03-10 17:16:13 -0400 |
commit | 806d3d71e25658c3df770d677c6ad73b9a7b13ae (patch) | |
tree | c62f80899bdad185a7a67bf3eec0cedc1f07533a /test/report | |
parent | d73d86166541dd121235f708f83d2ad9cf24b997 (diff) | |
download | android-node-v8-806d3d71e25658c3df770d677c6ad73b9a7b13ae.tar.gz android-node-v8-806d3d71e25658c3df770d677c6ad73b9a7b13ae.tar.bz2 android-node-v8-806d3d71e25658c3df770d677c6ad73b9a7b13ae.zip |
report: rename triggerReport() to writeReport()
writeReport() is more descriptive of what the function does.
PR-URL: https://github.com/nodejs/node/pull/26527
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test/report')
-rw-r--r-- | test/report/test-report-writereport.js (renamed from test/report/test-report-triggerreport.js) | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/report/test-report-triggerreport.js b/test/report/test-report-writereport.js index c89959ae87..6c7ed8a71c 100644 --- a/test/report/test-report-triggerreport.js +++ b/test/report/test-report-writereport.js @@ -27,19 +27,19 @@ function validate() { { // Test with no arguments. - process.report.triggerReport(); + process.report.writeReport(); validate(); } { // Test with an error argument. - process.report.triggerReport(new Error('test error')); + process.report.writeReport(new Error('test error')); validate(); } { // Test with a file argument. - const file = process.report.triggerReport('custom-name-1.json'); + const file = process.report.writeReport('custom-name-1.json'); const absolutePath = path.join(tmpdir.path, file); assert.strictEqual(helper.findReports(process.pid, tmpdir.path).length, 0); assert.strictEqual(file, 'custom-name-1.json'); @@ -49,8 +49,8 @@ function validate() { { // Test with file and error arguments. - const file = process.report.triggerReport('custom-name-2.json', - new Error('test error')); + const file = process.report.writeReport('custom-name-2.json', + new Error('test error')); const absolutePath = path.join(tmpdir.path, file); assert.strictEqual(helper.findReports(process.pid, tmpdir.path).length, 0); assert.strictEqual(file, 'custom-name-2.json'); @@ -61,7 +61,7 @@ function validate() { { // Test with a filename option. process.report.filename = 'custom-name-3.json'; - const file = process.report.triggerReport(); + const file = process.report.writeReport(); assert.strictEqual(helper.findReports(process.pid, tmpdir.path).length, 0); const filename = path.join(process.report.directory, 'custom-name-3.json'); assert.strictEqual(file, process.report.filename); @@ -72,21 +72,21 @@ function validate() { // Test with an invalid file argument. [null, 1, Symbol(), function() {}].forEach((file) => { common.expectsError(() => { - process.report.triggerReport(file); + process.report.writeReport(file); }, { code: 'ERR_INVALID_ARG_TYPE' }); }); // Test with an invalid error argument. [null, 1, Symbol(), function() {}, 'foo'].forEach((error) => { common.expectsError(() => { - process.report.triggerReport('file', error); + process.report.writeReport('file', error); }, { code: 'ERR_INVALID_ARG_TYPE' }); }); { // Test the special "stdout" filename. const args = ['--experimental-report', '-e', - 'process.report.triggerReport("stdout")']; + 'process.report.writeReport("stdout")']; const child = spawnSync(process.execPath, args, { cwd: tmpdir.path }); assert.strictEqual(child.status, 0); assert.strictEqual(child.signal, null); @@ -97,7 +97,7 @@ function validate() { { // Test the special "stderr" filename. const args = ['--experimental-report', '-e', - 'process.report.triggerReport("stderr")']; + 'process.report.writeReport("stderr")']; const child = spawnSync(process.execPath, args, { cwd: tmpdir.path }); assert.strictEqual(child.status, 0); assert.strictEqual(child.signal, null); @@ -113,7 +113,7 @@ function validate() { const args = ['--experimental-report', `--diagnostic-report-directory=${reportDir}`, '-e', - 'process.report.triggerReport()']; + 'process.report.writeReport()']; const child = spawnSync(process.execPath, args, { cwd: tmpdir.path }); assert.strictEqual(child.status, 0); |