Skip to content

Commit

Permalink
Merge pull request #3 from joeybaker/master
Browse files Browse the repository at this point in the history
Fix console.* causing incorrect test failures
  • Loading branch information
namuol committed Sep 10, 2015
2 parents 82712ed + c283b57 commit 2e5f171
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bin/tap-difflet
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ tap.on('assert', function(res) {

tap.on('extra', function(res) {
if (res !== '') {
try {
res = yaml.safeLoad(res);
} catch (e) {}
errors.push(chalk.gray(res));
output(errors[errors.length-1]);
output('\n');
if (res.indexOf('---') === 0){
errors.push(chalk.gray(res));
output(errors[errors.length-1]);
output('\n');
} else {
output(' ' + chalk.blue(res));
output('\n');
}
}
});

Expand Down
6 changes: 6 additions & 0 deletions test/pass.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ test('2 === 2', function(assert) {
assert.plan(1);
assert.equal(2, 2);
});

test('Does not error with comment', function(assert){
assert.plan(1);
console.log('a comment');
assert.pass('can console.log');
})

0 comments on commit 2e5f171

Please sign in to comment.