| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,5 +8,22 @@ const helper = require('../common/report'); | |||
| 8 | 8 | common.expectWarning('ExperimentalWarning', | |
| 9 | 9 | 'report is an experimental feature. This feature could ' + | |
| 10 | 10 | 'change at any time'); | |
| 11 | - helper.validateContent(process.report.getReport()); | ||
| 12 | - assert.deepStrictEqual(helper.findReports(process.pid, process.cwd()), []); | ||
| 11 | + | ||
| 12 | + { | ||
| 13 | + // Test with no arguments. | ||
| 14 | + helper.validateContent(process.report.getReport()); | ||
| 15 | + assert.deepStrictEqual(helper.findReports(process.pid, process.cwd()), []); | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + { | ||
| 19 | + // Test with an error argument. | ||
| 20 | + helper.validateContent(process.report.getReport(new Error('test error'))); | ||
| 21 | + assert.deepStrictEqual(helper.findReports(process.pid, process.cwd()), []); | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + // Test with an invalid error argument. | ||
| 25 | + [null, 1, Symbol(), function() {}, 'foo'].forEach((error) => { | ||
| 26 | + common.expectsError(() => { | ||
| 27 | + process.report.getReport(error); | ||
| 28 | + }, { code: 'ERR_INVALID_ARG_TYPE' }); | ||
| 29 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments