Skip to content

Drop Node.js 8; require the most recent Node.js releases; bump dependencies #2313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# Hardcoded versions due to https://github.com/actions/setup-node/issues/27,
# which means that sometimes too old a version gets installed.
node-version: [8.16.1, ^10.0.0, ^12.0.0, ^13.0.0]
node-version: [^10.18.0, ^12.14.0, ^13.5.0]
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v1
Expand All @@ -30,9 +28,9 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm ci --no-audit
- run: npm test
- run: npx codecov --file=./coverage/lcov.info
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

lockfile_churn:
name: Test package-lock for unexpected modifications
Expand All @@ -43,9 +41,9 @@ jobs:
fetch-depth: 1
- uses: actions/setup-node@v1
with:
node-version: ^12.0.0
node-version: ^12.14.0
- name: Upgrade npm
run: if [[ "$(npm -v)" != "6.12.1" ]]; then npm install --global npm@6.12.1; fi
run: if [[ "$(npm -v)" != "6.13.4" ]]; then npm install --global npm@6.13.4; fi
- run: npm ci --no-audit
- name: Test package-lock for unexpected modifications
run: |
Expand All @@ -66,6 +64,6 @@ jobs:
fetch-depth: 1
- uses: actions/setup-node@v1
with:
node-version: ^12.0.0
node-version: ^12.14.0
- run: npm install --no-shrinkwrap --no-audit
- run: npm test
2 changes: 1 addition & 1 deletion docs/recipes/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Translations: [Español](https://github.com/avajs/ava-docs/blob/master/es_ES/doc

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

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.
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.

## Configuring AVA to compile TypeScript files on the fly

Expand Down
2 changes: 1 addition & 1 deletion lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class Api extends Emittery {
}

// --inspect-brk is used in addition to --inspect to break on first line and wait
const inspectArgIndex = execArgv.findIndex(arg => /^--inspect(-brk)?($|=)/.test(arg));
const inspectArgIndex = execArgv.findIndex(arg => /^--inspect(?:-brk)?(?:$|=)/.test(arg));
if (inspectArgIndex === -1) {
return Promise.resolve(execArgv);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/beautify-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let ignoreStackLines = [];

const avaInternals = /\/ava\/(?:lib\/|lib\/worker\/)?[\w-]+\.js:\d+:\d+\)?$/;
const avaDependencies = /\/node_modules\/(?:append-transform|bluebird|empower-core|nyc|require-precompiled|(?:ava\/node_modules\/)?(?:babel-runtime|core-js))\//;
const stackFrameLine = /^.+( \(.+:\d+:\d+\)|:\d+:\d+)$/;
const stackFrameLine = /^.+( \(.+:\d+:\d+\)|:\d+:\d+)$/; // eslint-disable-line prefer-named-capture-group

if (!debug.enabled) {
ignoreStackLines = StackUtils.nodeInternals();
Expand Down Expand Up @@ -71,5 +71,5 @@ module.exports = stack => {
.trim()
// Remove remaining file:// prefixes, inserted by `esm`, that are not
// cleaned up by `stack-utils`
.split('\n').map(line => line.replace(/\(file:\/\/([^/].+:\d+:\d+)\)$/, '($1)')).join('\n');
.split('\n').map(line => line.replace(/\(file:\/\/(?<path>[^/].+:\d+:\d+)\)$/, '($<path>)')).join('\n');
};
4 changes: 2 additions & 2 deletions lib/chalk.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const Chalk = require('chalk').constructor;
const chalk = require('chalk');

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

ctx = new Chalk(options);
ctx = new chalk.Instance(options);
return ctx;
};
18 changes: 9 additions & 9 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,44 +72,44 @@ exports.run = async () => { // eslint-disable-line complexity
match: {
type: 'string',
alias: 'm',
default: conf.match
...'match' in conf && {default: conf.match}
},
'update-snapshots': {
type: 'boolean',
alias: 'u'
},
'fail-fast': {
type: 'boolean',
default: conf.failFast
...'failFast' in conf && {default: conf.failFast}
},
timeout: {
type: 'string',
alias: 'T',
default: conf.timeout
...'timeout' in conf && {default: conf.timeout}
},
serial: {
type: 'boolean',
alias: 's',
default: conf.serial
...'serial' in conf && {default: conf.serial}
},
concurrency: {
type: 'string',
alias: 'c',
default: conf.concurrency
...'concurrency' in conf && {default: conf.concurrency}
},
verbose: {
type: 'boolean',
alias: 'v',
default: conf.verbose
...'verbose' in conf && {default: conf.verbose}
},
tap: {
type: 'boolean',
alias: 't',
default: conf.tap
...'tap' in conf && {default: conf.tap}
},
color: {
type: 'boolean',
default: 'color' in conf ? conf.color : require('supports-color').stdout !== false
...'color' in conf && {default: conf.color}
},
'reset-cache': {
type: 'boolean',
Expand Down Expand Up @@ -223,7 +223,7 @@ exports.run = async () => { // eslint-disable-line complexity
parallelRuns = {currentIndex, totalRuns};
}

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

const files = cli.input.map(file => path.relative(resolveTestsFrom, path.resolve(process.cwd(), file)));
Expand Down
4 changes: 2 additions & 2 deletions lib/concordance-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const chalk = require('./chalk').get();
const avaReactPlugin = {...reactPlugin, name: 'ava-plugin-react'};
const plugins = [avaReactPlugin];

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

const colorTheme = {
boolean: ansiStyles.yellow,
Expand Down Expand Up @@ -124,7 +124,7 @@ const plainTheme = cloneDeepWith(colorTheme, value => {
}
});

const theme = chalk.enabled ? colorTheme : plainTheme;
const theme = chalk.level > 0 ? colorTheme : plainTheme;

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