aboutsummaryrefslogtreecommitdiff
path: root/node_modules/ava/lib/test.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-12-27 19:33:54 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-27 19:34:16 +0100
commit0e6de2c31dbf8c21277481f112e99c52b913940f (patch)
tree91789032de3b8eec9d789acd1323f25fc5d08422 /node_modules/ava/lib/test.js
parentceda0da31ad542c598c68146ae0712ca03df3d71 (diff)
node_modules
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'));