Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Improve formating of strings with 'dedent' tag #3401

Merged
merged 1 commit into from Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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