You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('puts large object values on multiple lines if line is long (> 80 chars)',()=>{
114
+
constprinted=print(
115
+
parse(
116
+
'{trip(obj:{wheelchair:false,smallObj:{a: 1},largeObj:{wheelchair:false,smallObj:{a: 1},arriveBy:false,includePlannedCancellations:true,transitDistanceReluctance:2000,anotherLongFieldName:"Lots and lots and lots and lots of text"},arriveBy:false,includePlannedCancellations:true,transitDistanceReluctance:2000,anotherLongFieldName:"Lots and lots and lots and lots of text"}){dateTime}}',
117
+
),
118
+
);
119
+
120
+
expect(printed).to.equal(dedent`
121
+
{
122
+
trip(
123
+
obj: {
124
+
wheelchair: false,
125
+
smallObj: { a: 1 },
126
+
largeObj: {
127
+
wheelchair: false,
128
+
smallObj: { a: 1 },
129
+
arriveBy: false,
130
+
includePlannedCancellations: true,
131
+
transitDistanceReluctance: 2000,
132
+
anotherLongFieldName: "Lots and lots and lots and lots of text"
133
+
},
134
+
arriveBy: false,
135
+
includePlannedCancellations: true,
136
+
transitDistanceReluctance: 2000,
137
+
anotherLongFieldName: "Lots and lots and lots and lots of text"
138
+
}
139
+
) {
140
+
dateTime
141
+
}
142
+
}
143
+
`);
144
+
});
145
+
146
+
it('puts large list values on multiple lines if line is long (> 80 chars)',()=>{
147
+
constprinted=print(
148
+
parse(
149
+
'{trip(list:[["small array", "small", "small"], ["Lots and lots and lots and lots of text", "Lots and lots and lots and lots of text", "Lots and lots and lots and lots of text"]]){dateTime}}',
150
+
),
151
+
);
152
+
153
+
expect(printed).to.equal(dedent`
154
+
{
155
+
trip(
156
+
list: [
157
+
["small array", "small", "small"],
158
+
[
159
+
"Lots and lots and lots and lots of text",
160
+
"Lots and lots and lots and lots of text",
161
+
"Lots and lots and lots and lots of text"
162
+
]
163
+
]
164
+
) {
165
+
dateTime
166
+
}
167
+
}
168
+
`);
169
+
});
170
+
113
171
it('Legacy: prints fragment with variable directives',()=>{
114
172
constqueryASTWithVariableDirective=parse(
115
173
'fragment Foo($foo: TestType @test) on TestType @testDirective { id }',
0 commit comments