aboutsummaryrefslogtreecommitdiff
path: root/node_modules/ava/lib/run-status.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/ava/lib/run-status.js')
-rw-r--r--node_modules/ava/lib/run-status.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/node_modules/ava/lib/run-status.js b/node_modules/ava/lib/run-status.js
index 8e095655a..461ab8f90 100644
--- a/node_modules/ava/lib/run-status.js
+++ b/node_modules/ava/lib/run-status.js
@@ -44,6 +44,7 @@ class RunStatus extends EventEmitter {
autoBind(this);
}
+
observeFork(emitter) {
emitter
.on('teardown', this.handleTeardown)
@@ -54,6 +55,7 @@ class RunStatus extends EventEmitter {
.on('stdout', this.handleOutput.bind(this, 'stdout'))
.on('stderr', this.handleOutput.bind(this, 'stderr'));
}
+
handleRejections(data) {
this.rejectionCount += data.rejections.length;
@@ -64,6 +66,7 @@ class RunStatus extends EventEmitter {
this.errors.push(err);
});
}
+
handleExceptions(data) {
this.exceptionCount++;
const err = data.exception;
@@ -72,10 +75,12 @@ class RunStatus extends EventEmitter {
this.emit('error', err, this);
this.errors.push(err);
}
+
handleTeardown(data) {
this.emit('dependencies', data.file, data.dependencies, this);
this.emit('touchedFiles', data.touchedFiles);
}
+
handleStats(stats) {
this.emit('stats', stats, this);
@@ -85,6 +90,7 @@ class RunStatus extends EventEmitter {
this.testCount += stats.testCount;
}
+
handleTest(test) {
test.title = this.prefixTitle(test.file) + test.title;
@@ -98,6 +104,7 @@ class RunStatus extends EventEmitter {
this.emit('test', test, this);
}
+
prefixTitle(file) {
if (!this.prefixTitles) {
return '';
@@ -107,9 +114,11 @@ class RunStatus extends EventEmitter {
return prefixTitle(file, this.base, separator);
}
+
handleOutput(channel, data) {
this.emit(channel, data, this);
}
+
processResults(results) {
// Assemble stats from all tests
this.stats = results.map(result => result.stats);