Skip to content

Commit 99770a0

Browse files
telenordtargos
telenord
authored andcommitted
test: test cover cases when trace is empty
cover prepare_stack_trace in case when trace is empty PR-URL: #30311 Reviewed-By: Gireesh Punathil <[email protected]>
1 parent 78b2d86 commit 99770a0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"use strict";
2+
3+
Error.stackTraceLimit = 0;
4+
throw new RangeError('emptyStackError');
5+
6+

test/parallel/test-source-map.js

+12
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,18 @@ function nextdir() {
255255
}
256256
}
257257

258+
// trace.length === 0 .
259+
{
260+
const output = spawnSync(process.execPath, [
261+
'--enable-source-maps',
262+
require.resolve('../fixtures/source-map/emptyStackError.js')
263+
]);
264+
265+
assert.ok(
266+
output.stderr.toString().match('emptyStackError')
267+
);
268+
}
269+
258270
function getSourceMapFromCache(fixtureFile, coverageDirectory) {
259271
const jsonFiles = fs.readdirSync(coverageDirectory);
260272
for (const jsonFile of jsonFiles) {

0 commit comments

Comments
 (0)