From 3afcbdf6140578971ed12a495ebec1db423da470 Mon Sep 17 00:00:00 2001 From: jwallet Date: Thu, 21 Dec 2023 18:27:15 -0500 Subject: [PATCH] test --- test/unit/replication-graphql.test.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/test/unit/replication-graphql.test.ts b/test/unit/replication-graphql.test.ts index f4eac17229e..0198cd5bb05 100644 --- a/test/unit/replication-graphql.test.ts +++ b/test/unit/replication-graphql.test.ts @@ -198,7 +198,6 @@ describe('replication-graphql.test.ts', () => { }, { query: '{ info }', - operationName: 'info', variables: {} } ); @@ -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();