Skip to content

Commit d039f39

Browse files
committed
Bump dependencies
1 parent 6936f40 commit d039f39

16 files changed

+2355
-1462
lines changed

docs/recipes/typescript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Translations: [Español](https://github.com/avajs/ava-docs/blob/master/es_ES/doc
44

55
AVA comes bundled with a TypeScript definition file. This allows developers to leverage TypeScript for writing tests.
66

7-
This guide assumes you've already set up TypeScript for your project. Note that AVA's definition has been tested with version 3.6.3.
7+
This guide assumes you've already set up TypeScript for your project. Note that AVA's definition has been tested with version 3.7.4.
88

99
## Configuring AVA to compile TypeScript files on the fly
1010

lib/chalk.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
const Chalk = require('chalk').constructor;
2+
const chalk = require('chalk');
33

44
let ctx = null;
55
exports.get = () => {
@@ -15,6 +15,6 @@ exports.set = options => {
1515
throw new Error('Chalk has already been configured');
1616
}
1717

18-
ctx = new Chalk(options);
18+
ctx = new chalk.Instance(options);
1919
return ctx;
2020
};

lib/cli.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,44 +72,44 @@ exports.run = async () => { // eslint-disable-line complexity
7272
match: {
7373
type: 'string',
7474
alias: 'm',
75-
default: conf.match
75+
...'match' in conf && {default: conf.match}
7676
},
7777
'update-snapshots': {
7878
type: 'boolean',
7979
alias: 'u'
8080
},
8181
'fail-fast': {
8282
type: 'boolean',
83-
default: conf.failFast
83+
...'failFast' in conf && {default: conf.failFast}
8484
},
8585
timeout: {
8686
type: 'string',
8787
alias: 'T',
88-
default: conf.timeout
88+
...'timeout' in conf && {default: conf.timeout}
8989
},
9090
serial: {
9191
type: 'boolean',
9292
alias: 's',
93-
default: conf.serial
93+
...'serial' in conf && {default: conf.serial}
9494
},
9595
concurrency: {
9696
type: 'string',
9797
alias: 'c',
98-
default: conf.concurrency
98+
...'concurrency' in conf && {default: conf.concurrency}
9999
},
100100
verbose: {
101101
type: 'boolean',
102102
alias: 'v',
103-
default: conf.verbose
103+
...'verbose' in conf && {default: conf.verbose}
104104
},
105105
tap: {
106106
type: 'boolean',
107107
alias: 't',
108-
default: conf.tap
108+
...'tap' in conf && {default: conf.tap}
109109
},
110110
color: {
111111
type: 'boolean',
112-
default: 'color' in conf ? conf.color : require('supports-color').stdout !== false
112+
...'color' in conf && {default: conf.color}
113113
},
114114
'reset-cache': {
115115
type: 'boolean',
@@ -223,7 +223,7 @@ exports.run = async () => { // eslint-disable-line complexity
223223
parallelRuns = {currentIndex, totalRuns};
224224
}
225225

226-
const match = arrify(conf.match);
226+
const match = conf.match === '' ? [] : arrify(conf.match);
227227
const resolveTestsFrom = cli.input.length === 0 ? projectDir : process.cwd();
228228

229229
const files = cli.input.map(file => path.relative(resolveTestsFrom, path.resolve(process.cwd(), file)));

lib/concordance-options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const chalk = require('./chalk').get();
1111
const avaReactPlugin = {...reactPlugin, name: 'ava-plugin-react'};
1212
const plugins = [avaReactPlugin];
1313

14-
const forceColor = new chalk.constructor({enabled: true});
14+
const forceColor = new chalk.Instance({level: Math.max(chalk.level, 1)});
1515

1616
const colorTheme = {
1717
boolean: ansiStyles.yellow,
@@ -124,7 +124,7 @@ const plainTheme = cloneDeepWith(colorTheme, value => {
124124
}
125125
});
126126

127-
const theme = chalk.enabled ? colorTheme : plainTheme;
127+
const theme = chalk.level > 0 ? colorTheme : plainTheme;
128128

129129
exports.default = {
130130
// Use Node's object inspection depth, clamped to a minimum of 3

0 commit comments

Comments
 (0)