@japa/snapshot
Version:
Snapshot testing plugin for Japa
27 lines (26 loc) • 698 B
TypeScript
import type { PluginFn } from '@japa/runner/types';
import type { SnapshotPluginOptions } from './src/types.js';
/**
* Extend the Assert interface to add the snapshot method
*/
declare module '@japa/assert' {
interface Assert {
snapshot(value: any): {
matchInline(inlineSnapshot?: string): void;
match(): void;
};
}
}
/**
* Extend the Expect interface to add the snapshot method
*/
declare module 'expect' {
interface Matchers<R> {
toMatchSnapshot(): R;
toMatchInlineSnapshot(inlineSnapshot?: string): R;
}
}
/**
* Snapshot plugin for Japa
*/
export declare function snapshot(options?: SnapshotPluginOptions): PluginFn;