Skip to content

Commit a81c7c5

Browse files
committed
Tests: Reduce use of any
1 parent f92f189 commit a81c7c5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

apps/oxlint/test/isSpaceBetween.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { Node } from "../src-js/plugins/types.js";
77
let sourceText: string | null = null;
88

99
vi.mock("../src-js/plugins/source_code.ts", async (importOriginal) => {
10-
const original: any = await importOriginal();
10+
const original: Record<string, unknown> = await importOriginal();
1111
return {
1212
...original,
1313
get sourceText(): string {
@@ -55,9 +55,10 @@ describe("isSpaceBetween()", () => {
5555
["let foo = 1;let foo2 = 2; let foo3 = 3;", true],
5656
] satisfies [string, boolean][]) {
5757
it(`should return ${expected} for ${code}`, () => {
58-
const { body } = parse(code, { range: true, sourceType: "module" });
5958
sourceText = code;
60-
expect(isSpaceBetween(body[0] as any as Node, body.at(-1) as any as Node)).toBe(expected);
59+
const ast = parse(sourceText, { range: true, sourceType: "module" }),
60+
body = ast.body as unknown as Node[];
61+
expect(isSpaceBetween(body[0]!, body.at(-1)!)).toBe(expected);
6162
});
6263
}
6364
});
@@ -129,7 +130,7 @@ describe("isSpaceBetweenTokens()", () => {
129130
sourceType: "module",
130131
jsx: true,
131132
}),
132-
body = ast.body as any as Node[],
133+
body = ast.body as unknown as Node[],
133134
tokens = ast.tokens;
134135

135136
expect(isSpaceBetweenTokens(tokens[0], body[0])).toBe(false);

0 commit comments

Comments
 (0)