Skip to content

Commit 0976cfe

Browse files
authored
Dependency updates
* Use c8 rather than nyc * Fix reporter tests flaking out
1 parent 1222ce9 commit 0976cfe

File tree

11 files changed

+948
-971
lines changed

11 files changed

+948
-971
lines changed

.c8rc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"all": true,
3+
"exclude": [
4+
"{coverage,media,test-d,test-tap}/**",
5+
"*.config.js",
6+
"index.d.ts"
7+
],
8+
"reporter": [
9+
"html",
10+
"lcov"
11+
]
12+
}

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
node_modules
2-
.nyc_output
32
coverage
4-
test/.tmpdir

lib/assert.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,16 +491,16 @@ class Assertions {
491491
savedError,
492492
values: [formatWithLabel(`${wasReturned ? 'Returned promise' : 'Promise'} resolved with:`, value)]
493493
});
494-
}, reason => {
494+
}, error => {
495495
assertExpectations({
496496
assertion: 'throwsAsync',
497-
actual: reason,
497+
actual: error,
498498
expectations,
499499
message,
500500
prefix: `${wasReturned ? 'Returned promise' : 'Promise'} rejected with`,
501501
savedError
502502
});
503-
return reason;
503+
return error;
504504
});
505505

506506
pending(intermediate);

lib/reporters/verbose.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ const whileCorked = require('./while-corked');
2020

2121
const nodeInternals = require('stack-utils').nodeInternals();
2222

23-
// Display duration only over a threshold. The environment variable is checked
24-
// to reduce variability within AVA's own test suite. Don't use it.
25-
const durationThreshold = Math.max(100, Number.parseInt(process.env.AVA_VERBOSE_DURATION_THRESHOLD, 10) || 0);
26-
2723
class LineWriter extends stream.Writable {
2824
constructor(dest) {
2925
super();
@@ -57,6 +53,7 @@ class LineWriter extends stream.Writable {
5753

5854
class VerboseReporter {
5955
constructor(options) {
56+
this.durationThreshold = options.durationThreshold || 100;
6057
this.reportStream = options.reportStream;
6158
this.stdStream = options.stdStream;
6259
this.watching = options.watching;
@@ -331,7 +328,7 @@ class VerboseReporter {
331328
} else if (evt.knownFailing) {
332329
this.lineWriter.writeLine(`${colors.error(figures.tick)} ${colors.error(this.prefixTitle(evt.testFile, evt.title))}`);
333330
} else {
334-
const duration = evt.duration > durationThreshold ? colors.duration(' (' + prettyMs(evt.duration) + ')') : '';
331+
const duration = evt.duration > this.durationThreshold ? colors.duration(' (' + prettyMs(evt.duration) + ')') : '';
335332

336333
this.lineWriter.writeLine(`${colors.pass(figures.tick)} ${this.prefixTitle(evt.testFile, evt.title)}${duration}`);
337334
}

nyc.config.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)