ava 6.4.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,7 @@
1
- import {inspect} from 'node:util';
1
+ import {inspect, stripVTControlCharacters} from 'node:util';
2
2
 
3
3
  import ansiStyles from 'ansi-styles';
4
4
  import {Chalk} from 'chalk'; // eslint-disable-line unicorn/import-style
5
- import stripAnsi from 'strip-ansi';
6
5
 
7
6
  import {chalk} from './chalk.js';
8
7
 
@@ -85,7 +84,7 @@ const colorTheme = {
85
84
  undefined: ansiStyles.yellow,
86
85
  };
87
86
 
88
- const plainTheme = JSON.parse(JSON.stringify(colorTheme), (_name, value) => typeof value === 'string' ? stripAnsi(value) : value);
87
+ const plainTheme = JSON.parse(JSON.stringify(colorTheme), (_name, value) => typeof value === 'string' ? stripVTControlCharacters(value) : value);
89
88
 
90
89
  const theme = chalk.level > 0 ? colorTheme : plainTheme;
91
90
 
package/lib/fork.js CHANGED
@@ -104,6 +104,11 @@ export default function loadFork(file, options, execArgv = process.execArgv) {
104
104
  }
105
105
 
106
106
  switch (message.ava.type) {
107
+ case 'worker-finished': {
108
+ send({type: 'free-worker'});
109
+ break;
110
+ }
111
+
107
112
  case 'ready-for-options': {
108
113
  send({type: 'options', options});
109
114
  break;
@@ -1,9 +1,9 @@
1
1
  import os from 'node:os';
2
2
  import path from 'node:path';
3
+ import {stripVTControlCharacters} from 'node:util';
3
4
 
4
5
  import indentString from 'indent-string';
5
6
  import plur from 'plur';
6
- import stripAnsi from 'strip-ansi';
7
7
  import * as supertap from 'supertap';
8
8
 
9
9
  import prefixTitle from './prefix-title.js';
@@ -20,7 +20,7 @@ function dumpError({
20
20
  if (type === 'unknown') {
21
21
  return {
22
22
  message: 'Non-native error',
23
- formatted: stripAnsi(formattedError),
23
+ formatted: stripVTControlCharacters(formattedError),
24
24
  };
25
25
  }
26
26
 
@@ -33,8 +33,8 @@ function dumpError({
33
33
 
34
34
  if (formattedDetails.length > 0) {
35
35
  originalError.details = Object.fromEntries(formattedDetails.map(({label, formatted}) => [
36
- stripAnsi(label),
37
- stripAnsi(formatted),
36
+ stripVTControlCharacters(label),
37
+ stripVTControlCharacters(formatted),
38
38
  ]));
39
39
  }
40
40
  }
@@ -119,7 +119,7 @@ export default class TapReporter {
119
119
  }
120
120
 
121
121
  writeComment(evt, {title = this.prefixTitle(evt.testFile, evt.title)}) {
122
- this.reportStream.write(`# ${stripAnsi(title)}${os.EOL}`);
122
+ this.reportStream.write(`# ${stripVTControlCharacters(title)}${os.EOL}`);
123
123
  if (evt.logs) {
124
124
  for (const log of evt.logs) {
125
125
  const logLines = indentString(log, 4).replaceAll(/^ {4}/gm, '# ');
@@ -120,6 +120,15 @@ const run = async options => {
120
120
  return;
121
121
  }
122
122
 
123
+ channel.send({type: 'worker-finished'});
124
+
125
+ // Reference the channel until the worker is freed. This should prevent Node.js from terminating the child process
126
+ // prematurely, which has been witnessed on Windows. See discussion at
127
+ // <https://github.com/avajs/ava/issues/3390#issuecomment-3056119361>.
128
+ channel.ref();
129
+ await channel.workerFreed;
130
+ channel.unref();
131
+
123
132
  nowAndTimers.setImmediate(() => {
124
133
  const unhandled = currentlyUnhandled();
125
134
  if (unhandled.length === 0) {
@@ -107,7 +107,9 @@ handle.ref();
107
107
 
108
108
  exports.options = selectAvaMessage(handle.channel, 'options').then(message => message.ava.options);
109
109
  exports.peerFailed = selectAvaMessage(handle.channel, 'peer-failed');
110
+ exports.workerFreed = selectAvaMessage(handle.channel, 'free-worker');
110
111
  exports.send = handle.send.bind(handle);
112
+ exports.ref = handle.ref.bind(handle);
111
113
  exports.unref = handle.unref.bind(handle);
112
114
 
113
115
  let channelCounter = 0;
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "ava",
3
- "version": "6.4.0",
3
+ "version": "7.0.0",
4
4
  "description": "Node.js test runner that lets you develop with confidence.",
5
5
  "license": "MIT",
6
- "repository": "avajs/ava",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/avajs/ava.git"
9
+ },
7
10
  "homepage": "https://avajs.dev",
8
11
  "bin": {
9
12
  "ava": "entrypoints/cli.mjs"
@@ -36,7 +39,7 @@
36
39
  },
37
40
  "type": "module",
38
41
  "engines": {
39
- "node": "^18.18 || ^20.8 || ^22 || ^23 || >=24"
42
+ "node": "^20.19 || ^22.20 || ^24.12 || >=25"
40
43
  },
41
44
  "scripts": {
42
45
  "test": "./scripts/test.sh"
@@ -83,64 +86,68 @@
83
86
  "typescript"
84
87
  ],
85
88
  "dependencies": {
86
- "@vercel/nft": "^0.29.4",
87
- "acorn": "^8.14.1",
88
- "acorn-walk": "^8.3.4",
89
- "ansi-styles": "^6.2.1",
89
+ "@vercel/nft": "^1.3.2",
90
+ "acorn": "^8.16.0",
91
+ "acorn-walk": "^8.3.5",
92
+ "ansi-styles": "^6.2.3",
90
93
  "arrgv": "^1.0.2",
91
94
  "arrify": "^3.0.0",
92
95
  "callsites": "^4.2.0",
93
- "cbor": "^10.0.3",
94
- "chalk": "^5.4.1",
96
+ "cbor": "^10.0.11",
97
+ "chalk": "^5.6.2",
95
98
  "chunkd": "^2.0.1",
96
- "ci-info": "^4.2.0",
99
+ "ci-info": "^4.4.0",
97
100
  "ci-parallel-vars": "^1.0.1",
98
- "cli-truncate": "^4.0.0",
101
+ "cli-truncate": "^5.1.1",
99
102
  "code-excerpt": "^4.0.0",
100
103
  "common-path-prefix": "^3.0.0",
101
104
  "concordance": "^5.0.4",
102
105
  "currently-unhandled": "^0.4.1",
103
- "debug": "^4.4.1",
104
- "emittery": "^1.1.0",
106
+ "debug": "^4.4.3",
107
+ "emittery": "^1.2.0",
105
108
  "figures": "^6.1.0",
106
- "globby": "^14.1.0",
109
+ "globby": "^16.1.1",
107
110
  "ignore-by-default": "^2.1.0",
108
111
  "indent-string": "^5.0.0",
109
112
  "is-plain-object": "^5.0.0",
110
113
  "is-promise": "^4.0.0",
111
- "matcher": "^5.0.0",
112
- "memoize": "^10.1.0",
114
+ "matcher": "^6.0.0",
115
+ "memoize": "^10.2.0",
113
116
  "ms": "^2.1.3",
114
- "p-map": "^7.0.3",
117
+ "p-map": "^7.0.4",
115
118
  "package-config": "^5.0.0",
116
- "picomatch": "^4.0.2",
117
- "plur": "^5.1.0",
118
- "pretty-ms": "^9.2.0",
119
+ "picomatch": "^4.0.3",
120
+ "plur": "^6.0.0",
121
+ "pretty-ms": "^9.3.0",
119
122
  "resolve-cwd": "^3.0.0",
120
123
  "stack-utils": "^2.0.6",
121
- "strip-ansi": "^7.1.0",
122
124
  "supertap": "^3.0.1",
123
125
  "temp-dir": "^3.0.0",
124
- "write-file-atomic": "^6.0.0",
125
- "yargs": "^17.7.2"
126
+ "write-file-atomic": "^7.0.0",
127
+ "yargs": "^18.0.0"
126
128
  },
127
129
  "devDependencies": {
128
130
  "@ava/test": "github:avajs/test",
129
- "@ava/typescript": "^5.0.0",
130
- "@sindresorhus/tsconfig": "^5.1.1",
131
- "@types/node": "^22.15.30",
132
- "ansi-escapes": "^7.0.0",
133
- "c8": "^10.1.3",
134
- "execa": "^9.6.0",
135
- "expect": "^29.7.0",
136
- "sinon": "^20.0.0",
137
- "tap": "^21.1.0",
138
- "tempy": "^3.1.0",
139
- "tsd": "^0.32.0",
140
- "typescript": "~5.8.3",
141
- "xo": "^1.0.5",
131
+ "@ava/typescript": "^6.0.0",
132
+ "@sindresorhus/tsconfig": "^8.1.0",
133
+ "@types/node": "^24.10.15",
134
+ "ansi-escapes": "^7.3.0",
135
+ "c8": "^11.0.0",
136
+ "execa": "^9.6.1",
137
+ "expect": "^30.2.0",
138
+ "sinon": "^21.0.1",
139
+ "tap": "^21.6.2",
140
+ "tempy": "^3.2.0",
141
+ "tsd": "^0.33.0",
142
+ "typescript": "~5.9.3",
143
+ "xo": "^1.2.3",
142
144
  "zen-observable": "^0.10.0"
143
145
  },
146
+ "overrides": {
147
+ "c8": {
148
+ "yargs": "^18.0.0"
149
+ }
150
+ },
144
151
  "peerDependencies": {
145
152
  "@ava/typescript": "*"
146
153
  },
@@ -150,7 +157,7 @@
150
157
  }
151
158
  },
152
159
  "volta": {
153
- "node": "22.16.0",
154
- "npm": "11.4.1"
160
+ "node": "24.14.0",
161
+ "npm": "11.11.0"
155
162
  }
156
163
  }