UNPKG

@seedts/testing

Version:

Testing utilities for SeedTS - Snapshot testing, deterministic seeding, and test helpers

42 lines 1.27 kB
/** * Jest integration for SeedTS testing * * Provides custom matchers and utilities for testing seeds with Jest */ import type { SnapshotOptions } from '../types.js'; /** * Custom Jest matcher: toMatchSeedSnapshot * * Usage with Jest: * ```typescript * import { expect } from '@jest/globals'; * import { extendJestMatchers } from '@seedts/testing/jest'; * * extendJestMatchers(expect); * * test('users seed snapshot', async () => { * const result = await executor.execute(); * await expect(result[0].data).toMatchSeedSnapshot('users'); * }); * ``` */ export declare function extendJestMatchers(expect: any): void; /** * Jest helper to create seed snapshot tests * * @example * ```typescript * import { describe, it } from '@jest/globals'; * import { createSeedTest } from '@seedts/testing/jest'; * * describe('Seed Snapshots', () => { * const testSeed = createSeedTest(); * * it('users seed', async () => { * await testSeed('users', UsersSeed, adapter); * }); * }); * ``` */ export declare function createSeedTest(): (name: string, _seedFn: (props: Record<string, any>) => any, _adapter: any, data: any[], options?: SnapshotOptions) => Promise<import("../types.js").SnapshotResult>; //# sourceMappingURL=jest.d.ts.map