Skip to content

Commit cf0fa4c

Browse files
Update dependencies, rely on Node.js 18, other small changes
* Update dependencies * Rely on Node.js 18 language features * Other small changes * Upgrade to tap@18 * Develop and test with [email protected] * Rebuild lockfile --------- Co-authored-by: Mark Wubben <[email protected]>
1 parent 03a6723 commit cf0fa4c

File tree

33 files changed

+8514
-8187
lines changed

33 files changed

+8514
-8187
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest
4242
strategy:
4343
matrix:
44-
ts-version: [~5.1]
44+
ts-version: [~5.2]
4545
steps:
4646
- uses: actions/checkout@v3
4747
- uses: actions/setup-node@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.tap
12
/coverage
23
/media/**/node_modules/
34
/node_modules/

.taprc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
browser: false
2-
coverage: false
1+
disable-coverage: true
2+
allow-empty-coverage: true
33
files:
44
- "test-tap/*.js"
55
- "test-tap/reporters/*.js"
66
- "test-tap/integration/*.js"
7-
flow: false
8-
jsx: false
97
timeout: 300
10-
ts: false

.xo-config.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ module.exports = {
99
'media/**',
1010
'test/config/fixtures/config-errors/test.js',
1111
'test/line-numbers/fixtures/line-numbers.js',
12+
'test/**/fixtures',
1213
'test-tap/fixture/snapshots/test-sourcemaps/build/**',
1314
'test-tap/fixture/report/edgecases/ast-syntax-error.cjs',
15+
'test-types',
1416
'examples/typescript-*/**/*.ts',
1517
],
1618
rules: {
@@ -25,6 +27,7 @@ module.exports = {
2527
],
2628
'import/newline-after-import': 'error',
2729
'unicorn/require-post-message-target-origin': 'off',
30+
'unicorn/prefer-event-target': 'off',
2831
},
2932
overrides: [
3033
{

docs/recipes/endpoint-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Since tests run concurrently, it's best to create a fresh server instance at lea
1111
Check out the example below:
1212

1313
```js
14-
import http from 'http';
14+
import http from 'node:http';
1515
import test from 'ava';
1616
import got from 'got';
1717
import listen from 'test-listen';

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/main/es_ES/docs/
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 expects at least version 5.1.
7+
This guide assumes you've already set up TypeScript for your project. Note that AVA's definition expects at least version 5.2.
88

99
## Enabling AVA's support for TypeScript test files
1010

docs/recipes/when-to-use-plan.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ As stated in the previous example, using the `t.throws()` assertion with `async`
9898
In most cases, it's a bad idea to use any complex branching inside your tests. A notable exception is for tests that are auto-generated (perhaps from a JSON document). Below `t.plan()` is used to ensure the correctness of the JSON input:
9999

100100
```js
101-
import fs from 'fs';
102-
import path from 'path';
101+
import fs from 'node:fs';
102+
import path from 'node:path';
103103

104104
const testData = JSON.parse(fs.readFileSync(new URL('./fixtures/test-definitions.json', import.meta.url)));
105105

lib/line-numbers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const sortNumbersAscending = array => {
1313
};
1414

1515
const parseNumber = string => Number.parseInt(string, 10);
16-
const removeAllWhitespace = string => string.replace(/\s/g, '');
16+
const removeAllWhitespace = string => string.replaceAll(/\s/g, '');
1717
const range = (start, end) => Array.from({length: end - start + 1}).fill(start).map((element, index) => element + index);
1818

1919
const parseLineNumbers = suffix => sortNumbersAscending(distinctArray(

lib/load-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import process from 'node:process';
44
import url from 'node:url';
55

66
import {isPlainObject} from 'is-plain-object';
7-
import {packageConfig, packageJsonPath} from 'pkg-conf';
7+
import {packageConfig, packageJsonPath} from 'package-config';
88

99
const NO_SUCH_FILE = Symbol('no ava.config.js file');
1010
const MISSING_DEFAULT_EXPORT = Symbol('missing default export');

lib/parse-test-args.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const buildTitle = (raw, implementation, args) => {
22
let value = implementation?.title?.(raw, ...args) ?? raw;
33
const isValid = typeof value === 'string';
44
if (isValid) {
5-
value = value.trim().replace(/\s+/g, ' ');
5+
value = value.trim().replaceAll(/\s+/g, ' ');
66
}
77

88
return {

0 commit comments

Comments
 (0)