Skip to content

Commit

Permalink
Merge pull request #8 from caitp/multiline-bug
Browse files Browse the repository at this point in the history
fix(ddescribe-iit): weird multiline line-number reporting bug
  • Loading branch information
caitp committed Jul 16, 2015
2 parents a1c5a1f + 16f6cf4 commit ba02d50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -86,7 +86,8 @@ function ddescribeIit(opt) {

result += (normalize(lines.length, lineNo, true) + underline(renderColumn, word0.length) + '\n');
while (words.length) {
result += (normalize(lines.length, lineNo) + lines[lineNo++] + '\n');
var nextLine = lines[lineNo++];
result += (normalize(lines.length, lineNo) + nextLine + '\n');
var start = /[^\s]/.exec(words[0]);
if (start) {
start = start.index;
Expand Down
12 changes: 6 additions & 6 deletions test/ddescribe-iit.spec.js
Expand Up @@ -528,8 +528,8 @@ describe('gulp-ddescribe-iit', function() {
" 1| ",
" 2| describe . ",
" | ^^^^^^^^^^^^^^^",
" 2| ",
" 3| only();",
" 3| ",
" 4| only();",
" | ^^^^",
" 5| //This should look good!",
"",
Expand All @@ -538,8 +538,8 @@ describe('gulp-ddescribe-iit', function() {
" 5| //This should look good!",
" 6| describe .",
" | ^^^^^^^^^^^^^^^",
" 6| ",
" 7| only(function() { ",
" 7| ",
" 8| only(function() { ",
" | ^^^^",
" 9| }); //This should look good!",
"",
Expand All @@ -548,7 +548,7 @@ describe('gulp-ddescribe-iit', function() {
" 9| }); //This should look good!",
" 10| describe ",
" | ^^^^^^^^",
" 10| [ \"only\" ]();",
" 11| [ \"only\" ]();",
" | ^^^^^^^^^^^^",
" 12| //This should look good!",
"",
Expand All @@ -557,7 +557,7 @@ describe('gulp-ddescribe-iit', function() {
" 12| //This should look good!",
" 13| describe ",
" | ^^^^^^^^",
" 13| [ 'only' ](function() { ",
" 14| [ 'only' ](function() { ",
" | ^^^^^^^^^^^",
" 15| });",
""
Expand Down

0 comments on commit ba02d50

Please sign in to comment.