Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Fix sourcemapped stacktrace output to use the original column number
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeChampion committed Jun 15, 2020
1 parent b64671d commit 4a400a0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/plugins/listr-karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ module.exports = function () {
errors.push(colors.red(error.join('\n')));

if (isCI) {
const error = value.log.map(log => formatError(log, '\t')).join('\n').split('\n');
const message = error.filter(log => log.trim().length).shift().trim();
const [file, line, column] = error.pop().trim().replace('at ', '').split(':');
const error = value.log.map(log => formatError(log, '\t')).join('\n').split('\n').filter(log => log.trim().length);
const message = error.shift().trim();
// eslint-disable-next-line prefer-const
let [file, line, column] = error.pop().trim().replace('at ', '').split(':');
column = Number.parseInt(column, 10);
const fullTestDescription = value.suite.map((suite) => suite + ' > ').join('') + value.description;

const errorMessage = fullTestDescription + '\n' + browser.name + ' errored with: ' + message;
Expand Down

0 comments on commit 4a400a0

Please sign in to comment.