Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
regadas committed Nov 5, 2024
1 parent d5f6b83 commit c12d44e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/it/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c12d44e

Please sign in to comment.