diff options
Diffstat (limited to 'packages/cli/src/test-utils/customMatchers.ts')
| -rw-r--r-- | packages/cli/src/test-utils/customMatchers.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/cli/src/test-utils/customMatchers.ts b/packages/cli/src/test-utils/customMatchers.ts index c0b4df6b..26eac07b 100644 --- a/packages/cli/src/test-utils/customMatchers.ts +++ b/packages/cli/src/test-utils/customMatchers.ts @@ -12,15 +12,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { expect } from 'vitest'; +import { Assertion, expect } from 'vitest'; import type { TextBuffer } from '../ui/components/shared/text-buffer.js'; // RegExp to detect invalid characters: backspace, and ANSI escape codes // eslint-disable-next-line no-control-regex const invalidCharsRegex = /[\b\x1b]/; -function toHaveOnlyValidCharacters(this: vi.Assertion, buffer: TextBuffer) { - const { isNot } = this; +function toHaveOnlyValidCharacters(this: Assertion, buffer: TextBuffer) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const { isNot } = this as any; let pass = true; const invalidLines: Array<{ line: number; content: string }> = []; @@ -50,7 +51,8 @@ function toHaveOnlyValidCharacters(this: vi.Assertion, buffer: TextBuffer) { expect.extend({ toHaveOnlyValidCharacters, -}); + // eslint-disable-next-line @typescript-eslint/no-explicit-any +} as any); // Extend Vitest's `expect` interface with the custom matcher's type definition. declare module 'vitest' { |
