fix: lint and check

pull/18505/head
paoloricciuti 3 months ago
parent 114be1c593
commit 0490721eef

@ -9,6 +9,23 @@ import renderer, { create_root, serialize, dispatch_event, dom_elements } from '
import { writeFile } from 'node:fs/promises'; import { writeFile } from 'node:fs/promises';
import { globSync } from 'tinyglobby'; import { globSync } from 'tinyglobby';
// `_config.js` test callbacks rely on inferred parameter types, which
// TypeScript treats as non-explicit and rejects for chai's assertion-function
// signatures (TS2775). Override the assertion methods we use with
// non-assertion equivalents; runtime behavior is unchanged.
type NonAssertingMethods = {
ok(value: unknown, message?: string): void;
isOk(value: unknown, message?: string): void;
isTrue(value: unknown, message?: string): void;
isFalse(value: unknown, message?: string): void;
exists(value: unknown, message?: string): void;
notExists(value: unknown, message?: string): void;
instanceOf(value: unknown, type: Function, message?: string): void;
};
type Assert = Omit<typeof import('vitest').assert, keyof NonAssertingMethods> &
NonAssertingMethods;
export interface CustomRendererTest extends BaseTest { export interface CustomRendererTest extends BaseTest {
html?: string; html?: string;
compileOptions?: Partial<CompileOptions>; compileOptions?: Partial<CompileOptions>;
@ -20,7 +37,7 @@ export interface CustomRendererTest extends BaseTest {
runtime_error?: string; runtime_error?: string;
warnings?: string[]; warnings?: string[];
test?: (args: { test?: (args: {
assert: typeof import('vitest').assert; assert: Assert;
target: any; target: any;
component: Record<string, any>; component: Record<string, any>;
mod: any; mod: any;

Loading…
Cancel
Save