Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Machinecode reporter: Filter stack line with errors in types.js #161

Open
wants to merge 2 commits into from

1 participant

Sebastian Kusnier
Sebastian Kusnier
  • Without this filter the filename is wrong
  • This makes problems with the vim plugins: nodeunit.vim and vim-markgreen On unit test errors vim jumps to the types.js file

Same solution as in https://github.com/kusnier/nodeunit/blob/master/lib/reporters/tap.js#L52

kusnier added some commits
Sebastian Kusnier kusnier Filter stack line with regex /types.js:83:39/
- Without this filter the filename is wrong
- This makes problems with the vim plugins: nodeunit.vim and vim-markgreen
  On unit test errors vim jumps to the types.js file
16de704
Sebastian Kusnier kusnier Always filter types.js in stack trace 0a1b803
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 4, 2012
  1. Sebastian Kusnier

    Filter stack line with regex /types.js:83:39/

    kusnier authored
    - Without this filter the filename is wrong
    - This makes problems with the vim plugins: nodeunit.vim and vim-markgreen
      On unit test errors vim jumps to the types.js file
  2. Sebastian Kusnier
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/reporters/machineout.js
5 lib/reporters/machineout.js
View
@@ -58,7 +58,10 @@ exports.run = function (files, options, callback) {
if (delimiter === undefined) {
delimiter = ':';
}
- traceback = stack.split('\n');
+ traceback = stack.split(/\n/).filter(function (line) {
+ // exclude line of "types.js"
+ return ! RegExp(/nodeunit\/lib\/types.js:/).test(line);
+ });
firstline = traceback.shift();
trace = parseTrace(traceback[0]);
return {filename: trace.filename, row: trace.row, column: trace.column, message: firstline};
Something went wrong with that request. Please try again.