use jest-snapshot to apply the snapshot testing

This commit is contained in:
Yanzhen Yu
2018-10-12 16:28:06 +08:00
parent ffc2b01796
commit 3e5c0adcdc
8 changed files with 172 additions and 105 deletions

17
test.d.ts vendored
View File

@@ -2,3 +2,20 @@ declare module 'rollup-plugin-typescript' {
function typescript(): any;
export = typescript;
}
declare module 'jest-snapshot' {
export class SnapshotState {
constructor(testFile: string, options: any);
save(): any;
}
type matchResult = {
pass: boolean;
report(): string;
};
export function toMatchSnapshot(
received: any,
propertyMatchers?: any,
testName?: string,
): matchResult;
}