diff --git a/test/lib/browsers/base.ts b/test/lib/browsers/base.ts index 0fcddebc0e30b..24210848f83c1 100644 --- a/test/lib/browsers/base.ts +++ b/test/lib/browsers/base.ts @@ -14,9 +14,14 @@ export abstract class BrowserInterface implements PromiseLike { private promise?: Promise then: Promise['then'] catch: Promise['catch'] - finally: Promise['finally'] + finally: Promise['finally']; - protected chain(nextCall: any): BrowserInterface { + // necessary for the type of the function below + readonly [Symbol.toStringTag]: string = 'BrowserInterface' + + protected chain( + nextCall: (current: any) => T | PromiseLike + ): BrowserInterface & Promise { if (!this.promise) { this.promise = Promise.resolve(this) }