Skip to content

Commit

Permalink
Dependency updates
Browse files Browse the repository at this point in the history
* Use c8 rather than nyc
* Fix reporter tests flaking out
  • Loading branch information
novemberborn authored Apr 26, 2020
1 parent 1222ce9 commit 0976cfe
Show file tree
Hide file tree
Showing 11 changed files with 948 additions and 971 deletions.
12 changes: 12 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"all": true,
"exclude": [
"{coverage,media,test-d,test-tap}/**",
"*.config.js",
"index.d.ts"
],
"reporter": [
"html",
"lcov"
]
}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
node_modules
.nyc_output
coverage
test/.tmpdir
6 changes: 3 additions & 3 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,16 +491,16 @@ class Assertions {
savedError,
values: [formatWithLabel(`${wasReturned ? 'Returned promise' : 'Promise'} resolved with:`, value)]
});
}, reason => {
}, error => {
assertExpectations({
assertion: 'throwsAsync',
actual: reason,
actual: error,
expectations,
message,
prefix: `${wasReturned ? 'Returned promise' : 'Promise'} rejected with`,
savedError
});
return reason;
return error;
});

pending(intermediate);
Expand Down
7 changes: 2 additions & 5 deletions lib/reporters/verbose.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ const whileCorked = require('./while-corked');

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

// Display duration only over a threshold. The environment variable is checked
// to reduce variability within AVA's own test suite. Don't use it.
const durationThreshold = Math.max(100, Number.parseInt(process.env.AVA_VERBOSE_DURATION_THRESHOLD, 10) || 0);

class LineWriter extends stream.Writable {
constructor(dest) {
super();
Expand Down Expand Up @@ -57,6 +53,7 @@ class LineWriter extends stream.Writable {

class VerboseReporter {
constructor(options) {
this.durationThreshold = options.durationThreshold || 100;
this.reportStream = options.reportStream;
this.stdStream = options.stdStream;
this.watching = options.watching;
Expand Down Expand Up @@ -331,7 +328,7 @@ class VerboseReporter {
} else if (evt.knownFailing) {
this.lineWriter.writeLine(`${colors.error(figures.tick)} ${colors.error(this.prefixTitle(evt.testFile, evt.title))}`);
} else {
const duration = evt.duration > durationThreshold ? colors.duration(' (' + prettyMs(evt.duration) + ')') : '';
const duration = evt.duration > this.durationThreshold ? colors.duration(' (' + prettyMs(evt.duration) + ')') : '';

this.lineWriter.writeLine(`${colors.pass(figures.tick)} ${this.prefixTitle(evt.testFile, evt.title)}${duration}`);
}
Expand Down
14 changes: 0 additions & 14 deletions nyc.config.js

This file was deleted.

Loading

0 comments on commit 0976cfe

Please sign in to comment.