Skip to content

Commit f64528c

Browse files
committed
Real good testing of Jasmine augmentation typing
l
1 parent 4fd4bd5 commit f64528c

6 files changed

Lines changed: 672 additions & 946 deletions

File tree

jasmine.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ declare namespace jasmine {
1616
* We force Matchers to return a `Promise<void>` since under Jasmine's `expectAsync` everything is a promise.
1717
*/
1818
// eslint-disable-next-line @typescript-eslint/no-unused-vars
19-
interface AsyncMatchers<T, U> extends ExpectWebdriverIO.CustomMatchers<Promise<void>, T> {}
19+
interface AsyncMatchers<T, U> extends ExpectWebdriverIO.Matchers<Promise<void>, T> {}
2020
}

test-types/jasmine-global-expect-async/types-jasmine_async.test.ts

Lines changed: 259 additions & 373 deletions
Large diffs are not rendered by default.

test-types/jasmine/customMatchers/customMatchers-namespace.d.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
* Custom matchers under the `ExpectWebdriverIO` namespace.
33
* @see {@link https://webdriver.io/docs/custommatchers/#typescript-support}
44
*/
5-
declare namespace jasmine {
5+
declare namespace ExpectWebdriverIO {
6+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7+
interface Matchers<R, T> {
8+
toBeCustom(): Promise<void>;
9+
}
10+
}
611

12+
declare namespace jasmine {
713
// eslint-disable-next-line @typescript-eslint/no-unused-vars
814
interface AsyncMatchers<T, U> {
9-
toBeCustom(): Promise<void>;
10-
toBeCustomPromise: T extends ChainablePromiseElement ? (expected?: string | ExpectWebdriverIO.PartialMatcher<string> | Promise<ExpectWebdriverIO.PartialMatcher<string>>) => Promise<void> : never;
15+
toBeCustomJasmine(): Promise<void>;
1116
}
1217
}

0 commit comments

Comments
 (0)