Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: test cover prepare_stack_trace in case of trace is empty
  • Loading branch information
telenord committed Nov 6, 2019
commit c92176d4ef3bd296e82edf1001fb6accff90f859
14 changes: 3 additions & 11 deletions test/fixtures/source-map/emptyStackError.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
const ERROR_TEXT = 'emptyStackError';
"use strict";

function Hello() {
Error.stackTraceLimit = 0;
throw Error(ERROR_TEXT)
}
Error.stackTraceLimit = 0;
throw new RangeError('emptyStackError');

setImmediate(function () {
Hello();
});

module.exports = {
ERROR_TEXT
};
5 changes: 3 additions & 2 deletions test/parallel/test-source-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,14 @@ function nextdir() {

// trace.length === 0 .
{
const { ERROR_TEXT } = require('../fixtures/source-map/emptyStackError.js');
const output = spawnSync(process.execPath, [
'--enable-source-maps',
require.resolve('../fixtures/source-map/emptyStackError.js')
]);

console.log(output.stderr.toString());
assert.ok(
output.stderr.toString().match(ERROR_TEXT)
output.stderr.toString().match('emptyStackError')
);
}

Expand Down