export class FakePromise < T > { public readonly [ Symbol . toStringTag ] : string ; private _promise : Promise < T > ; private _res : ( t : T ) => void ; private _rej : ( e : any ) => void ; constructor ( ) { this . _promise = new Promise ( ( res , rej ) => { this . _res = res ; this . _rej = rej ; } ) ; } public resolve ( t ) { this . _res ( t ) ; } public reject ( t ) { this . _rej ( t ) ; } public then < T2 > ( t ) { return this . _promise . then ( t ) ; } public catch < T2 > ( t ) { return this . _promise . catch ( t ) ; } public finally ( ) { return this . _promise . finally ( ) ; } }