Skip to content

Commit

Permalink
[tb/LEMS-2727/editor-image-linting] Fix ts-expect-error
Browse files Browse the repository at this point in the history
  • Loading branch information
Myranae committed Feb 20, 2025
1 parent d09960d commit c010f2a
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions packages/perseus-linter/src/__tests__/rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,18 +497,24 @@ describe("Individual lint rules tests", () => {
},
});

// @ts-expect-error - TS2554 - Expected 3 arguments, but got 2.
expectWarning(imageUrlEmptyRule, [
"![alt-text]()", // empty URL
"![alt-text]( )", // empty URL with spaces
"![alt-text](\n)", // empty URL with newline
]);
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 2.
expectPass(imageUrlEmptyRule, [
"![alt-text]('something')", // text should pass, though not a valid URL
"![alt-text]('www.test.com')", // example URL
"![alt-text](56)", // example number should pass, though not a valid URL
]);
expectWarning(
imageUrlEmptyRule,
[
"![alt-text]()", // empty URL
"![alt-text]( )", // empty URL with spaces
"![alt-text](\n)", // empty URL with newline
],
null,
);
expectPass(
imageUrlEmptyRule,
[
"![alt-text]('something')", // text should pass, though not a valid URL
"![alt-text]('www.test.com')", // example URL
"![alt-text](56)", // example number should pass, though not a valid URL
],
null,
);

expectWarning(expressionWidgetRule, "[[☃ expression 1]]", {
widgets: {
Expand Down

0 comments on commit c010f2a

Please sign in to comment.