Skip to content

Commit 7493647

Browse files
committed
Relative path tests
1 parent 4923fe9 commit 7493647

6 files changed

Lines changed: 70 additions & 0 deletions

File tree

tests_integration/__tests__/__snapshots__/patterns-glob.js.snap

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,30 @@ outside.js
7979
`;
8080

8181
exports[`fixtures-3: Should only match \`outside.js\` and \`dir/inside.js\` (write) 1`] = `Array []`;
82+
83+
exports[`fixtures-4: Should match \`level-1.js\` #2 (stderr) 1`] = `""`;
84+
85+
exports[`fixtures-4: Should match \`level-1.js\` #2 (stdout) 1`] = `
86+
"0/level-1.js
87+
"
88+
`;
89+
90+
exports[`fixtures-4: Should match \`level-1.js\` #2 (write) 1`] = `Array []`;
91+
92+
exports[`fixtures-4: Should match \`level-1.js\` #3 (stderr) 1`] = `""`;
93+
94+
exports[`fixtures-4: Should match \`level-1.js\` #3 (stdout) 1`] = `
95+
"0/level-1.js
96+
"
97+
`;
98+
99+
exports[`fixtures-4: Should match \`level-1.js\` #3 (write) 1`] = `Array []`;
100+
101+
exports[`fixtures-4: Should match \`level-1.js\` (stderr) 1`] = `""`;
102+
103+
exports[`fixtures-4: Should match \`level-1.js\` (stdout) 1`] = `
104+
"0/level-1.js
105+
"
106+
`;
107+
108+
exports[`fixtures-4: Should match \`level-1.js\` (write) 1`] = `Array []`;

tests_integration/__tests__/patterns-glob.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,38 @@ describe("fixtures-3: Should exclude `.svn`", () => {
8686
status: 1
8787
});
8888
});
89+
90+
/*
91+
fixtures-4/
92+
├─ level-0.js
93+
└─ 0
94+
├─ level-1.js
95+
└─ 1/
96+
├─ level-2.js
97+
└─ 2/
98+
└─ level-3.js
99+
*/
100+
101+
describe("fixtures-4: Should match `level-1.js`", () => {
102+
runPrettier("cli/patterns-glob/fixtures-4", ["./0/./level-1.js", "-l"]).test({
103+
status: 1
104+
});
105+
});
106+
107+
describe("fixtures-4: Should match `level-1.js` #2", () => {
108+
runPrettier("cli/patterns-glob/fixtures-4", [
109+
"./0/1/2/../../level-1.js",
110+
"-l"
111+
]).test({
112+
status: 1
113+
});
114+
});
115+
116+
describe("fixtures-4: Should match `level-1.js` #3", () => {
117+
runPrettier("cli/patterns-glob/fixtures-4", [
118+
"./0/non-exists-dir/2/../../level-1.js",
119+
"-l"
120+
]).test({
121+
status: 1
122+
});
123+
});
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
foo
2+
.bar()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
foo
2+
.bar()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
foo
2+
.bar()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
foo
2+
.bar()

0 commit comments

Comments
 (0)