mirror of https://github.com/nodejs/node.git
test: test cover cases when trace is empty
cover prepare_stack_trace in case when trace is empty PR-URL: https://github.com/nodejs/node/pull/30311 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>pull/30622/head
parent
5de2afb94e
commit
d90219d9ad
|
@ -0,0 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
Error.stackTraceLimit = 0;
|
||||
throw new RangeError('emptyStackError');
|
||||
|
||||
|
|
@ -253,6 +253,18 @@ function nextdir() {
|
|||
}
|
||||
}
|
||||
|
||||
// trace.length === 0 .
|
||||
{
|
||||
const output = spawnSync(process.execPath, [
|
||||
'--enable-source-maps',
|
||||
require.resolve('../fixtures/source-map/emptyStackError.js')
|
||||
]);
|
||||
|
||||
assert.ok(
|
||||
output.stderr.toString().match('emptyStackError')
|
||||
);
|
||||
}
|
||||
|
||||
function getSourceMapFromCache(fixtureFile, coverageDirectory) {
|
||||
const jsonFiles = fs.readdirSync(coverageDirectory);
|
||||
for (const jsonFile of jsonFiles) {
|
||||
|
|
Loading…
Reference in New Issue