Skip to content

Commit d26f6e9

Browse files
tests: Improve formating of strings with 'dedent' tag (#3401)
1 parent cbbff7f commit d26f6e9

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/language/__tests__/printer-test.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,13 @@ describe('Printer: Query document', () => {
8080
parse('{trip(wheelchair:false arriveBy:false){dateTime}}'),
8181
);
8282

83-
expect(printed).to.equal(
84-
dedent`
83+
expect(printed).to.equal(dedent`
8584
{
8685
trip(wheelchair: false, arriveBy: false) {
8786
dateTime
8887
}
8988
}
90-
`,
91-
);
89+
`);
9290
});
9391

9492
it('puts arguments on multiple lines if line is long (> 80 chars)', () => {
@@ -98,8 +96,7 @@ describe('Printer: Query document', () => {
9896
),
9997
);
10098

101-
expect(printed).to.equal(
102-
dedent`
99+
expect(printed).to.equal(dedent`
103100
{
104101
trip(
105102
wheelchair: false
@@ -110,8 +107,7 @@ describe('Printer: Query document', () => {
110107
dateTime
111108
}
112109
}
113-
`,
114-
);
110+
`);
115111
});
116112

117113
it('Legacy: prints fragment with variable directives', () => {

src/utilities/__tests__/stripIgnoredCharacters-test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,10 @@ describe('stripIgnoredCharacters', () => {
396396
invariant(
397397
originalValue === strippedValue,
398398
dedent`
399-
Expected lexValue(stripIgnoredCharacters(${inspectStr(blockStr)}))
400-
to equal ${inspectStr(originalValue)}
401-
but got ${inspectStr(strippedValue)}
402-
`,
399+
Expected lexValue(stripIgnoredCharacters(${inspectStr(blockStr)}))
400+
to equal ${inspectStr(originalValue)}
401+
but got ${inspectStr(strippedValue)}
402+
`,
403403
);
404404
return expectStripped(blockStr);
405405
}

0 commit comments

Comments
 (0)