Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix: Use default assertion messages (fixes #6532) (#6615)
  • Loading branch information
aaronabramov authored and nzakas committed Jul 8, 2016
1 parent 2bdf22c commit ca323cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/testers/rule-tester.js
Expand Up @@ -395,7 +395,7 @@ RuleTester.prototype = {
if (typeof item.errors[i] === "string") {

// Just an error message.
assert.equal(messages[i].message, item.errors[i], "Error message should be " + item.errors[i]);
assert.equal(messages[i].message, item.errors[i]);
} else if (typeof item.errors[i] === "object") {

/*
Expand All @@ -404,7 +404,7 @@ RuleTester.prototype = {
* column.
*/
if (item.errors[i].message) {
assert.equal(messages[i].message, item.errors[i].message, "Error message should be " + item.errors[i].message);
assert.equal(messages[i].message, item.errors[i].message);
}

if (item.errors[i].type) {
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/testers/rule-tester.js
Expand Up @@ -119,7 +119,7 @@ describe("RuleTester", function() {
{ code: "var foo = bar;", errors: [{ message: "Bad error message." }] }
]
});
}, /Error message should be /);
}, /Bad var\..*==.*Bad error message/);
});

it("should throw an error when the error is neither an object nor a string", function() {
Expand Down Expand Up @@ -149,7 +149,7 @@ describe("RuleTester", function() {
{ code: "var foo = bar;", errors: ["Bad error message."] }
]
});
}, /Error message should be /);
}, /Bad var\..*==.*Bad error message/);
});

it("should not throw an error when the error is a string and it matches error message", function() {
Expand Down

0 comments on commit ca323cf

Please sign in to comment.