Skip to content

Commit

Permalink
tests: Improve formating of strings with 'dedent' tag (#3401)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Dec 3, 2021
1 parent cbbff7f commit d26f6e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
12 changes: 4 additions & 8 deletions src/language/__tests__/printer-test.ts
Expand Up @@ -80,15 +80,13 @@ describe('Printer: Query document', () => {
parse('{trip(wheelchair:false arriveBy:false){dateTime}}'),
);

expect(printed).to.equal(
dedent`
expect(printed).to.equal(dedent`
{
trip(wheelchair: false, arriveBy: false) {
dateTime
}
}
`,
);
`);
});

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

expect(printed).to.equal(
dedent`
expect(printed).to.equal(dedent`
{
trip(
wheelchair: false
Expand All @@ -110,8 +107,7 @@ describe('Printer: Query document', () => {
dateTime
}
}
`,
);
`);
});

it('Legacy: prints fragment with variable directives', () => {
Expand Down
8 changes: 4 additions & 4 deletions src/utilities/__tests__/stripIgnoredCharacters-test.ts
Expand Up @@ -396,10 +396,10 @@ describe('stripIgnoredCharacters', () => {
invariant(
originalValue === strippedValue,
dedent`
Expected lexValue(stripIgnoredCharacters(${inspectStr(blockStr)}))
to equal ${inspectStr(originalValue)}
but got ${inspectStr(strippedValue)}
`,
Expected lexValue(stripIgnoredCharacters(${inspectStr(blockStr)}))
to equal ${inspectStr(originalValue)}
but got ${inspectStr(strippedValue)}
`,
);
return expectStripped(blockStr);
}
Expand Down

0 comments on commit d26f6e9

Please sign in to comment.