Skip to content

Commit

Permalink
Fix test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Jan 20, 2024
1 parent 915ee67 commit 7ff925e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/utils/__tests__/report.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -426,5 +426,7 @@ test('without node nor line', () => {
result: {},
};

expect(() => report(v)).toThrow('You must pass either a node or a line number (rule: foo)');
expect(() => report(v)).toThrow(
'The "foo" rule failed to pass either a node or a line number to the `report()` function.',
);
});
4 changes: 3 additions & 1 deletion lib/utils/report.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ function report(problem) {
const startLine = line || (start && start.line);

if (!startLine) {
throw new Error(`You must pass either a node or a line number (rule: ${ruleName})`);
throw new Error(
`The "${ruleName}" rule failed to pass either a node or a line number to the \`report()\` function.`,
);
}

const { ignoreDisables } = result.stylelint.config || {};
Expand Down
4 changes: 3 additions & 1 deletion lib/utils/report.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export default function report(problem) {
const startLine = line || (start && start.line);

if (!startLine) {
throw new Error(`The "${ruleName}" rule failed to pass either a node or a line number to the `report()` function.`);
throw new Error(
`The "${ruleName}" rule failed to pass either a node or a line number to the \`report()\` function.`,
);
}

const { ignoreDisables } = result.stylelint.config || {};
Expand Down

0 comments on commit 7ff925e

Please sign in to comment.