Skip to content

Commit

Permalink
chore: cleanup message for missing suggestions when testing only the …
Browse files Browse the repository at this point in the history
…message
  • Loading branch information
DMartens committed Feb 1, 2024
1 parent d4cca7f commit 80d190f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rule-tester/rule-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ class RuleTester {

// Just an error message.
assertMessageMatches(message.message, error);
assert.ok(message.suggestions === void 0 || message.suggestions.length === 0, `The message has untested. suggestions. Please convert the error at index ${i} into an object by assigning this message to a 'message' property.`);
assert.ok(message.suggestions === void 0, `Error at index ${i} has suggestions. Please convert the test error into an object and specify 'suggestions' property on it to test suggestions.`);
} else if (typeof error === "object" && error !== null) {

/*
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rule-tester/rule-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ describe("RuleTester", () => {
{ code: "foo", errors: ["Avoid using identifiers named 'foo'."] }
]
});
}, "The message has untested. suggestions. Please convert the error at index 0 into an object by assigning this message to a 'message' property.");
}, "Error at index 0 has suggestions. Please convert the test error into an object and specify 'suggestions' property on it to test suggestions.");
});

it("should throw an error when the error is an object with an unknown property name", () => {
Expand Down

0 comments on commit 80d190f

Please sign in to comment.