File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -357,6 +357,11 @@ class EnvBuilder<
357357 }
358358}
359359
360+ export interface PassedAssertion < R , T > {
361+ result : R ;
362+ assertionResult : T ;
363+ }
364+
360365class CallableEnvBuilder <
361366 Args extends readonly any [ ] ,
362367 R ,
@@ -396,7 +401,7 @@ class CallableEnvBuilder<
396401 public async passes < AArgs extends readonly any [ ] , AResult > (
397402 assertion : ( val : Awaited < R > , ...assertionArgs : AArgs ) => AResult ,
398403 ...assertionArgs : AArgs
399- ) : Promise < AResult > {
404+ ) : Promise < PassedAssertion < R , AResult > > {
400405 // this.call() may or may not return a promise,
401406 // `Promise.resolve` turns the result into one if it isn't already,
402407 // and we then await it. That ensures that `result` is an `Awaited<R>`.
@@ -410,8 +415,8 @@ class CallableEnvBuilder<
410415 await delayedCheck ( this ) ;
411416 }
412417
413- // Return the result of the main assertion.
414- return assertionResult ;
418+ // Return the results of the function call and the main assertion.
419+ return { result , assertionResult } ;
415420 }
416421
417422 /**
You can’t perform that action at this time.
0 commit comments