Skip to content
Permalink
Browse files

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>
  • Loading branch information
telenord authored and MylesBorins committed Nov 6, 2019
1 parent 21be4b1 commit 0a068db450782fd069fa5dc95f0764f8464f6846
Showing with 18 additions and 0 deletions.
  1. +6 −0 test/fixtures/source-map/emptyStackError.js
  2. +12 −0 test/parallel/test-source-map.js
@@ -0,0 +1,6 @@
"use strict";

Error.stackTraceLimit = 0;
throw new RangeError('emptyStackError');


@@ -255,6 +255,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) {

0 comments on commit 0a068db

Please sign in to comment.
You can’t perform that action at this time.