From c12d44e55996fc1d78501ad6b594fc5e523d9ab6 Mon Sep 17 00:00:00 2001 From: regadas Date: Mon, 4 Nov 2024 19:24:49 -0500 Subject: [PATCH] Add test --- tests/it/client.spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/it/client.spec.ts b/tests/it/client.spec.ts index 827f2a61..1510d032 100644 --- a/tests/it/client.spec.ts +++ b/tests/it/client.spec.ts @@ -71,6 +71,22 @@ describe('trino', () => { expect(info.query).toBe(singleCustomerQuery); }); + test.concurrent('client extra header propagation', async () => { + const source = 'new-client'; + const trino = Trino.create({ + catalog: 'tpcds', + schema: 'sf100000', + auth: new BasicAuth('test'), + extraHeaders: {'X-Trino-Source': source}, + }); + + const query = await trino.query(singleCustomerQuery); + const qr = await query.next(); + + const info: any = await trino.queryInfo(qr.value.id); + expect(info.session.source).toBe(source); + }); + test.concurrent('query request header propagation', async () => { const trino = Trino.create({catalog: 'tpcds', auth: new BasicAuth('test')}); const query = await trino.query(useSchemaQuery);