UNPKG

expect-webdriverio

Version:

WebdriverIO Assertion Library

27 lines (25 loc) 1.16 kB
/// <reference types="./types/expect-webdriverio.d.ts"/> declare namespace jasmine { /** * Async matchers for Jasmine to allow the typing of `expectAsync` with WebDriverIO matchers. * T is the type of the actual value * U is the type of the expected value * Both T,U must stay named as they are to override the default `AsyncMatchers` type from Jasmine. * * We force Matchers to return a `Promise<void>` since Jasmine's `expectAsync` expects a promise in all cases (different from Jest) */ // eslint-disable-next-line @typescript-eslint/no-unused-vars interface AsyncMatchers<T, U> extends Omit<ExpectWebdriverIO.Matchers<Promise<void>, T>, 'toMatchSnapshot' | 'toMatchInlineSnapshot'> { /** * snapshot matcher * @param label optional snapshot label */ toMatchSnapshot(label?: string): Promise<void>; /** * inline snapshot matcher * @param snapshot snapshot string (autogenerated if not specified) * @param label optional snapshot label */ toMatchInlineSnapshot(snapshot?: string, label?: string): Promise<void>; } }