Skip to content

Commit c07fdd0

Browse files
committed
Fix JWT tests
1 parent d06f0da commit c07fdd0

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

packages/client-node/__tests__/integration/node_jwt_auth.test.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import type { ClickHouseClient } from '@clickhouse/client-common'
2-
import { createTestClient, TestEnv, whenOnEnv } from '@test/utils'
1+
import { TestEnv, whenOnEnv } from '@test/utils'
32
import { EnvKeys, getFromEnv } from '@test/utils/env'
3+
import { createClient } from '../../src'
4+
import type { NodeClickHouseClient } from '../../src/client'
45
import { makeJWT } from '../utils/jwt'
56

67
whenOnEnv(TestEnv.CloudSMT).describe('[Node.js] JWT auth', () => {
7-
let jwtClient: ClickHouseClient
8+
let jwtClient: NodeClickHouseClient
89
let url: string
910
let jwt: string
1011

@@ -17,7 +18,7 @@ whenOnEnv(TestEnv.CloudSMT).describe('[Node.js] JWT auth', () => {
1718
})
1819

1920
it('should work with client configuration', async () => {
20-
jwtClient = createTestClient({
21+
jwtClient = createClient({
2122
url,
2223
access_token: jwt,
2324
})
@@ -29,7 +30,7 @@ whenOnEnv(TestEnv.CloudSMT).describe('[Node.js] JWT auth', () => {
2930
})
3031

3132
it('should override the client instance auth', async () => {
32-
jwtClient = createTestClient({
33+
jwtClient = createClient({
3334
url,
3435
username: 'gibberish',
3536
password: 'gibberish',

packages/client-web/__tests__/jwt/web_jwt_auth.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import type { ClickHouseClient } from '@clickhouse/client-common'
2-
import { createTestClient } from '@test/utils'
31
import { EnvKeys, getFromEnv } from '@test/utils/env'
2+
import { createClient } from '../../src'
3+
import type { WebClickHouseClient } from '../../src/client'
44

55
/** Cannot use the jsonwebtoken library to generate the token: it is Node.js only.
66
* The access token should be generated externally before running the test,
77
* and set as the CLICKHOUSE_JWT_ACCESS_TOKEN environment variable */
88
describe('[Web] JWT auth', () => {
9-
let client: ClickHouseClient
9+
let client: WebClickHouseClient
1010
let url: string
1111
let jwt: string
1212

@@ -19,7 +19,7 @@ describe('[Web] JWT auth', () => {
1919
})
2020

2121
it('should work with client configuration', async () => {
22-
client = createTestClient({
22+
client = createClient({
2323
url,
2424
access_token: jwt,
2525
})
@@ -31,7 +31,7 @@ describe('[Web] JWT auth', () => {
3131
})
3232

3333
it('should override the client instance auth', async () => {
34-
client = createTestClient({
34+
client = createClient({
3535
url,
3636
username: 'gibberish',
3737
password: 'gibberish',

0 commit comments

Comments
 (0)