From 76cb9c2a39d477a64824a985ade40507e3bbade1 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Fri, 13 Feb 2026 21:34:48 -0800 Subject: feat(vanilla): add testing infrastructure and tests (NK-wjnczv) --- .../vitest/dist/chunks/global.d.B15mdLcR.d.ts | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 vanilla/node_modules/vitest/dist/chunks/global.d.B15mdLcR.d.ts (limited to 'vanilla/node_modules/vitest/dist/chunks/global.d.B15mdLcR.d.ts') diff --git a/vanilla/node_modules/vitest/dist/chunks/global.d.B15mdLcR.d.ts b/vanilla/node_modules/vitest/dist/chunks/global.d.B15mdLcR.d.ts new file mode 100644 index 0000000..17d0167 --- /dev/null +++ b/vanilla/node_modules/vitest/dist/chunks/global.d.B15mdLcR.d.ts @@ -0,0 +1,99 @@ +import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect'; +import { Plugin } from '@vitest/pretty-format'; +import { SnapshotState } from '@vitest/snapshot'; +import { B as BenchmarkResult } from './benchmark.d.DAaHLpsq.js'; +import { U as UserConsoleLog } from './rpc.d.RH3apGEf.js'; + +interface SnapshotMatcher { + (snapshot: Partial, hint?: string): void; + (hint?: string): void; +} +interface InlineSnapshotMatcher { + (properties: Partial, snapshot?: string, hint?: string): void; + (hint?: string): void; +} +declare module "@vitest/expect" { + interface MatcherState { + environment: string; + snapshotState: SnapshotState; + } + interface ExpectPollOptions { + interval?: number; + timeout?: number; + message?: string; + } + interface ExpectStatic { + assert: Chai.AssertStatic; + unreachable: (message?: string) => never; + soft: (actual: T, message?: string) => Assertion; + poll: (actual: () => T, options?: ExpectPollOptions) => PromisifyAssertion>; + addEqualityTesters: (testers: Array) => void; + assertions: (expected: number) => void; + hasAssertions: () => void; + addSnapshotSerializer: (plugin: Plugin) => void; + } + interface Assertion { + matchSnapshot: SnapshotMatcher; + toMatchSnapshot: SnapshotMatcher; + toMatchInlineSnapshot: InlineSnapshotMatcher; + /** + * Checks that an error thrown by a function matches a previously recorded snapshot. + * + * @param hint - Optional custom error message. + * + * @example + * expect(functionWithError).toThrowErrorMatchingSnapshot(); + */ + toThrowErrorMatchingSnapshot: (hint?: string) => void; + /** + * Checks that an error thrown by a function matches an inline snapshot within the test file. + * Useful for keeping snapshots close to the test code. + * + * @param snapshot - Optional inline snapshot string to match. + * @param hint - Optional custom error message. + * + * @example + * const throwError = () => { throw new Error('Error occurred') }; + * expect(throwError).toThrowErrorMatchingInlineSnapshot(`"Error occurred"`); + */ + toThrowErrorMatchingInlineSnapshot: (snapshot?: string, hint?: string) => void; + /** + * Compares the received value to a snapshot saved in a specified file. + * Useful for cases where snapshot content is large or needs to be shared across tests. + * + * @param filepath - Path to the snapshot file. + * @param hint - Optional custom error message. + * + * @example + * await expect(largeData).toMatchFileSnapshot('path/to/snapshot.json'); + */ + toMatchFileSnapshot: (filepath: string, hint?: string) => Promise; + } +} +declare module "@vitest/runner" { + interface TestContext { + /** + * `expect` instance bound to the current test. + * + * This API is useful for running snapshot tests concurrently because global expect cannot track them. + */ + readonly expect: ExpectStatic; + /** @internal */ + _local: boolean; + } + interface TaskMeta { + typecheck?: boolean; + benchmark?: boolean; + failScreenshotPath?: string; + } + interface File { + prepareDuration?: number; + environmentLoad?: number; + } + interface TaskBase { + logs?: UserConsoleLog[]; + } + interface TaskResult { + benchmark?: BenchmarkResult; + } +} -- cgit v1.2.3