Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallet committed Dec 21, 2023
1 parent 896f9b4 commit 3afcbdf
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion test/unit/replication-graphql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ describe('replication-graphql.test.ts', () => {
},
{
query: '{ info }',
operationName: 'info',
variables: {}
}
);
Expand All @@ -209,6 +208,27 @@ describe('replication-graphql.test.ts', () => {
assert.strictEqual(res.data.info, 1);
server.close();
});
it('spawn and throw an unknown operation name', async () => {
const server = await SpawnServer.spawn();
try {
await graphQLRequest(
ensureNotFalsy(server.url.http),
{
headers: {},
credentials: undefined
},
{
query: '{ info }',
operationName: 'info',
variables: {}
}
);
} catch (err: any) {
assert.ok(err.message.includes('Unknown operation named "info".'));
}

server.close();
});
it('server.setDocument()', async () => {
const server = await SpawnServer.spawn();
const doc = getTestData(1).pop();
Expand Down

0 comments on commit 3afcbdf

Please sign in to comment.