Skip to content

Commit d9b2447

Browse files
committed
editorconfig: Add test for finding VCS directory
It's a little hacky in that the .hg file isn't really a Mercurial repository, but it's enough to illustrate the intent. See here for context: #3559 (comment)
1 parent 0b2501b commit d9b2447

4 files changed

Lines changed: 25 additions & 0 deletions

File tree

tests_integration/__tests__/__snapshots__/config-resolution.js.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ function f() {
1818
\\"should have space width 8\\"
1919
)
2020
}
21+
function f() {
22+
console.log(
23+
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\"
24+
)
25+
}
2126
console.log(
2227
\\"jest/__best-tests__/file.js should have semi\\"
2328
);
@@ -108,6 +113,11 @@ function f() {
108113
function f() {
109114
console.log(\\"should have space width 8\\")
110115
}
116+
function f() {
117+
console.log(
118+
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\"
119+
)
120+
}
111121
console.log(\\"jest/__best-tests__/file.js should have semi\\");
112122
console.log(\\"jest/Component.js should not have semi\\")
113123
console.log(\\"jest/Component.test.js should have semi\\");

tests_integration/__tests__/__snapshots__/with-config-precedence.js.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ function f() {
9595
\\"should have space width 8\\"
9696
)
9797
}
98+
function f() {
99+
console.log(
100+
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\"
101+
)
102+
}
98103
console.log(
99104
\\"jest/__best-tests__/file.js should have semi\\"
100105
);
@@ -167,6 +172,11 @@ function f() {
167172
\\"should have space width 8\\"
168173
)
169174
}
175+
function f() {
176+
console.log(
177+
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\"
178+
)
179+
}
170180
console.log(
171181
\\"jest/__best-tests__/file.js should have semi\\"
172182
);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This isn't really a Mercurial repo, but we want to pretend it is for testing purposes.
2+
See https://github.com/prettier/prettier/pull/3559#issuecomment-353857109
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function f() {
2+
console.log("should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present");
3+
}

0 commit comments

Comments
 (0)