diff --git a/lib/test.js b/lib/test.js index ad86c1c4f..e99543b74 100644 --- a/lib/test.js +++ b/lib/test.js @@ -57,6 +57,19 @@ function timeout(ms) { this.timeout(ms); } +function stats() { + return { + assertCount: this.assertCount, + assertError: this.assertError, + calledEnd: this.calledEnd, + duration: this.duration, + finishing: this.finishing, + pendingAssertionCount: this.pendingAssertionCount, + planCount: this.planCount, + startedAt: this.startedAt + }; +} + const testMap = new WeakMap(); class ExecutionContext { constructor(test) { @@ -76,7 +89,8 @@ class ExecutionContext { }, { log: {value: log.bind(test)}, plan: {value: boundPlan}, - timeout: {value: timeout.bind(test)} + timeout: {value: timeout.bind(test)}, + stats: {value: stats.bind(test)} })); this.snapshot.skip = () => {