Skip to content

Commit

Permalink
Merge pull request jshint#299 from WolfgangKluge/test-helper-fix
Browse files Browse the repository at this point in the history
Fix filter function that detect "unthrown errors"
  • Loading branch information
valueof committed Oct 9, 2011
2 parents 10a5777 + d96cc92 commit 7923cf0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/testhelper
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ exports.setup.testRun = function (name){
} );

if (errors.length === 0 && definedErrors.length === 0) {
// return;
return;
}

// filter all thrown errors
Expand All @@ -65,8 +65,8 @@ exports.setup.testRun = function (name){
} );

// filter all defined errors
var unthrownErrors = definedErrors.filter( function(er) {
return !errors.some( function(def) {
var unthrownErrors = definedErrors.filter( function(def) {
return !errors.some( function(er) {
return def.line === er.line &&
def.message === er.reason;
} );
Expand Down

0 comments on commit 7923cf0

Please sign in to comment.