Skip to content

Commit 0a068db

Browse files
telenordMylesBorins
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 <gpunathi@in.ibm.com>
1 parent 21be4b1 commit 0a068db

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"use strict";
2+
3+
Error.stackTraceLimit=0;
4+
thrownewRangeError('emptyStackError');
5+
6+

‎test/parallel/test-source-map.js‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,18 @@ function nextdir() {
255255
}
256256
}
257257

258+
// trace.length === 0 .
259+
{
260+
constoutput=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
functiongetSourceMapFromCache(fixtureFile,coverageDirectory){
259271
constjsonFiles=fs.readdirSync(coverageDirectory);
260272
for(constjsonFileofjsonFiles){

0 commit comments

Comments
 (0)