Skip to content

Commit b2bdfb7

Browse files
committed
Keep the CLI error snapshots stable on Node.js 26
Node.js 26 appends the offending path to the `read` error raised when reading a directory, so `config-invalid` and `invalid-ignore` fail their snapshots there while passing on 14 through 22. Strip the appended path in runCli, which leaves the existing snapshots valid on every version rather than pinning them to one.
1 parent 0bc958e commit b2bdfb7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎tests/integration/run-cli.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ function runCli(dir, args = [], options = {}) {
188188
/\r/g,
189189
options.ignoreLineEndings ? "" : "/*CR*/",
190190
);
191+
192+
// Node.js 26 appends the path to the `read` error raised when reading a
193+
// directory; earlier versions stop at the syscall name.
194+
value = value.replace(
195+
/(?<=EISDIR: illegal operation on a directory, read) '[^'\n]*'/g,
196+
"",
197+
);
191198
}
192199

193200
if (name in testOptions) {

0 commit comments

Comments
 (0)