DefinitelyTyped/types/chai-jest-snapshot/index.d.ts
Arnulfo Solis Ramirez ee044bd8fa
Preparing for mocha 8 (#46017)
* Mocha parallel and jobs options

* Remove deprecated functions

* Removed deprecated types

* Replace MochaSetupOptions for MochaOptions in browser mode

* Update deps to not use deprecated interfaces

* Added unloadFiles to mocha
2020-07-12 01:16:01 -07:00

41 lines
1.2 KiB
TypeScript

// Type definitions for chai-jest-snapshot 1.3
// Project: https://github.com/suchipi/chai-jest-snapshot#readme
// Definitions by: Matt Perry <https://github.com/mattvperry>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
/// <reference types="chai" />
/// <reference types="mocha" />
declare global {
namespace Chai {
interface Assertion {
/** Assert that the object matches the snapshot */
matchSnapshot(snapshotFilename?: string, snapshotName?: string, update?: boolean): Assertion;
matchSnapshot(update: boolean): Assertion;
}
}
}
interface ChaiJestSnapshot extends Chai.ChaiPlugin {
/** Set snapshot file name */
setFilename(filename: string): void;
/**
* Set snapshot test name
*/
setTestName(testname: string): void;
/** Configure snapshot name using mocha context */
configureUsingMochaContext(context: Mocha.Context): void;
/** Reset snapshot registry */
resetSnapshotRegistry(): void;
/** Add a serializer plugin */
addSerializer(serializer: any): void;
}
declare var ChaiJestSnapshot: ChaiJestSnapshot;
export = ChaiJestSnapshot;