Skip to content

Commit 4847862

Browse files
committed
Add special case for v15 printSchema (adds new line)
1 parent 3704cd6 commit 4847862

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

library/sources/GraphQL.schema.tests.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ function getTestContext(): Context {
2525
}
2626

2727
export function createGraphQLTests(pkgName: string) {
28+
function expectedDSL(dsl: string): string {
29+
if (pkgName === "graphql-v15") {
30+
// GraphQL v15 printSchema adds a new line at the end
31+
return dsl + "\n";
32+
}
33+
34+
return dsl;
35+
}
36+
2837
t.test("it works", async () => {
2938
const api = new ReportingAPIForTesting();
3039
const agent = startTestAgent({
@@ -163,7 +172,7 @@ type Author {
163172
hits: hits,
164173
graphql: undefined,
165174
apispec: {},
166-
graphQLSchema: dsl,
175+
graphQLSchema: expectedDSL(dsl),
167176
},
168177
{
169178
method: "POST",

0 commit comments

Comments
 (0)