aboutsummaryrefslogtreecommitdiff
path: root/node_modules/ava/lib/test.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/ava/lib/test.js')
-rw-r--r--node_modules/ava/lib/test.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/node_modules/ava/lib/test.js b/node_modules/ava/lib/test.js
index 58be54d32..839101b40 100644
--- a/node_modules/ava/lib/test.js
+++ b/node_modules/ava/lib/test.js
@@ -71,6 +71,7 @@ class ExecutionContext {
_throwsArgStart(assertion, file, line) {
this._test.trackThrows({assertion, file, line});
}
+
_throwsArgEnd() {
this._test.trackThrows(null);
}
@@ -78,6 +79,10 @@ class ExecutionContext {
{
const assertions = assert.wrapAssertions({
+ log(executionContext, text) {
+ executionContext._test.addLog(text);
+ },
+
pass(executionContext) {
executionContext._test.countPassedAssertion();
},
@@ -108,6 +113,7 @@ class Test {
this.metadata = options.metadata;
this.onResult = options.onResult;
this.title = options.title;
+ this.logs = [];
this.snapshotInvocationCount = 0;
this.compareWithSnapshot = assertionOptions => {
@@ -175,6 +181,10 @@ class Test {
this.assertCount++;
}
+ addLog(text) {
+ this.logs.push(text);
+ }
+
addPendingAssertion(promise) {
if (this.finishing) {
this.saveFirstError(new Error('Assertion passed, but test has already finished'));