Fix test on Node.js v26 (#19927)
This commit is contained in:
1 parent
0bc958e734
commit
0283c8848e
4 files changed
+33
-19
No files matched your search
@@ -86,12 +86,3 @@ exports[`throw error with invalid config precedence option (configPrecedence) 1
|
||||
"write": [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`throw error with invalid config target (directory) 1`] = `
|
||||
{
|
||||
"stderr": "[error] Invalid configuration:
|
||||
[error] Unable to read '<cli>/config/invalid/folder/.prettierrc': EISDIR: illegal operation on a directory, read",
|
||||
"stdout": "",
|
||||
"write": [],
|
||||
}
|
||||
`;
|
||||
@@ -1,9 +0,0 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`throw error with invalid ignore 1`] = `
|
||||
{
|
||||
"stderr": "[error] Unable to read '.prettierignore': EISDIR: illegal operation on a directory, read",
|
||||
"stdout": "",
|
||||
"write": [],
|
||||
}
|
||||
`;
|
||||
@@ -35,6 +35,22 @@ describe("throw error with invalid config target (directory)", () => {
|
||||
"folder/.prettierrc", // this is a directory
|
||||
]).test({
|
||||
status: "non-zero",
|
||||
stderr:
|
||||
/*
|
||||
On Node.js<26
|
||||
|
||||
```
|
||||
EISDIR: illegal operation on a directory, read
|
||||
```
|
||||
|
||||
On Node.js>=26
|
||||
```
|
||||
EISDIR: illegal operation on a directory, read '<cli>/config/invalid/folder/.prettierrc'
|
||||
```
|
||||
*/
|
||||
expect.stringContaining("EISDIR: illegal operation on a directory, read"),
|
||||
stdout: "",
|
||||
write: [],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -7,6 +7,22 @@ const { __dirname } = createEsmUtils(import.meta);
|
||||
describe("throw error with invalid ignore", () => {
|
||||
runCli("cli/invalid-ignore", ["something.js"]).test({
|
||||
status: "non-zero",
|
||||
stderr:
|
||||
/*
|
||||
On Node.js<26
|
||||
|
||||
```
|
||||
EISDIR: illegal operation on a directory, read
|
||||
```
|
||||
|
||||
On Node.js>=26
|
||||
```
|
||||
EISDIR: illegal operation on a directory, read '...'
|
||||
```
|
||||
*/
|
||||
expect.stringContaining("EISDIR: illegal operation on a directory, read"),
|
||||
stdout: "",
|
||||
write: [],
|
||||
});
|
||||
|
||||
test("sync api", async () => {
|
||||
@@ -17,6 +33,6 @@ describe("throw error with invalid ignore", () => {
|
||||
"../cli/invalid-ignore/.prettierignore",
|
||||
),
|
||||
}),
|
||||
).rejects.toThrow(/EISDIR: illegal operation on a directory/);
|
||||
).rejects.toThrow(/EISDIR: illegal operation on a directory, read/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user