Skip to content

Commit 5df1161

Browse files
committed
More tests
1 parent 563cc61 commit 5df1161

2 files changed

Lines changed: 42 additions & 56 deletions

File tree

tests/format/typescript/union/comments/18379.ts

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,18 @@ type A2 =
1414
A | B
1515
)
1616

17-
// TODO: Fix the following two
18-
19-
// type A1 =
20-
// (
21-
// // comment 1
22-
// A | B
23-
// ) & (
24-
// // comment2
25-
// A | B
26-
// )
17+
type A1 =
18+
// comment 1
19+
(A | B)
20+
& (
21+
// comment2
22+
A | B
23+
)
2724

28-
// type A2 =
29-
// (
30-
// // prettier-ignore
31-
// A | B
32-
// ) & (
33-
// // prettier-ignore
34-
// A | B
35-
// )
25+
type A1 =
26+
// prettier-ignore
27+
(A | B)
28+
& (
29+
// prettier-ignore
30+
A | B
31+
)

tests/format/typescript/union/comments/__snapshots__/format.test.js.snap

Lines changed: 28 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -118,25 +118,21 @@ type A2 =
118118
A | B
119119
)
120120
121-
// TODO: Fix the following two
122-
123-
// type A1 =
124-
// (
125-
// // comment 1
126-
// A | B
127-
// ) & (
128-
// // comment2
129-
// A | B
130-
// )
131-
132-
// type A2 =
133-
// (
134-
// // prettier-ignore
135-
// A | B
136-
// ) & (
137-
// // prettier-ignore
138-
// A | B
139-
// )
121+
type A1 =
122+
// comment 1
123+
(A | B)
124+
& (
125+
// comment2
126+
A | B
127+
)
128+
129+
type A1 =
130+
// prettier-ignore
131+
(A | B)
132+
& (
133+
// prettier-ignore
134+
A | B
135+
)
140136
141137
=====================================output=====================================
142138
type A1 = (
@@ -153,25 +149,19 @@ type A2 = (
153149
// prettier-ignore
154150
(A | B);
155151
156-
// TODO: Fix the following two
157-
158-
// type A1 =
159-
// (
160-
// // comment 1
161-
// A | B
162-
// ) & (
163-
// // comment2
164-
// A | B
165-
// )
166-
167-
// type A2 =
168-
// (
169-
// // prettier-ignore
170-
// A | B
171-
// ) & (
172-
// // prettier-ignore
173-
// A | B
174-
// )
152+
type A1 =
153+
// comment 1
154+
(A | B) &
155+
// comment2
156+
(A | B);
157+
158+
type A1 =
159+
// prettier-ignore
160+
(A | B)
161+
& (
162+
// prettier-ignore
163+
A | B
164+
);
175165
176166
================================================================================
177167
`;

0 commit comments

Comments
 (0)