expect-webdriverio
Version:
WebdriverIO Assertion Library
37 lines (29 loc) • 1.48 kB
TypeScript
/// <reference types="./types/expect-webdriverio.d.ts"/>
/**
* Augment the Jest namespace to include the matchers from expect-webdriverio.
* When Jest Library is used, it specifies `expect-webdriverio/jest` for this file in the tsconfig.json's types.
*/
declare namespace jest {
interface Matchers<R extends void | Promise<void>, T> extends ExpectWebdriverIO.Matchers<R, T> {
/**
* Below are overloaded Jest's matchers not part of `expect` but of `jest-snapshot`.
* @see https://github.com/jestjs/jest/blob/73dbef5d2d3195a1e55fb254c54cce70d3036252/packages/jest-snapshot/src/types.ts#L37
*
* Note: We need to define them below so that they are correctly typed overloaded.
* Else even when extending `WdioJestOverloadedMatchers` we have typing errors.
*/
/**
* snapshot matcher
* @param label optional snapshot label
*/
toMatchSnapshot(label?: string): T extends WdioPromiseLike ? Promise<void> : void;
/**
* inline snapshot matcher
* @param snapshot snapshot string (autogenerated if not specified)
* @param label optional snapshot label
*/
toMatchInlineSnapshot(snapshot?: string, label?: string): T extends WdioPromiseLike ? Promise<void> : void;
}
interface Expect extends ExpectWebdriverIO.Expect {}
interface InverseAsymmetricMatchers extends ExpectWebdriverIO.AsymmetricMatchers {}
}