Skip to content

Commit 2d98554

Browse files
committed
handle exported interfaces and CJS artifacts
1 parent 8d4373a commit 2d98554

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

src/azure_auth_test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { use, expect } from 'chai';
22
import chaiAsPromised from 'chai-as-promised';
3-
import { join } from 'node:path';
3+
import { dirname, join } from 'node:path';
4+
import { fileURLToPath } from 'node:url';
45

56
import { User, Cluster } from './config_types.js';
67
import { AzureAuth } from './azure_auth.js';
78
import { KubeConfig } from './config.js';
89
import { HttpMethod, RequestContext } from './index.js';
910

11+
const __dirname = dirname(fileURLToPath(import.meta.url));
12+
1013
use(chaiAsPromised);
1114

1215
describe('AzureAuth', () => {

src/config_test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { readFileSync } from 'node:fs';
22
import https from 'node:https';
33
import { Agent, RequestOptions } from 'node:https';
4-
import path, { join } from 'node:path';
4+
import path, { dirname, join } from 'node:path';
5+
import { fileURLToPath } from 'node:url';
56

67
import { expect, use } from 'chai';
78
import chaiAsPromised from 'chai-as-promised';
@@ -26,6 +27,8 @@ const kcInvalidContextFileName = 'testdata/empty-context-kubeconfig.yaml';
2627
const kcInvalidClusterFileName = 'testdata/empty-cluster-kubeconfig.yaml';
2728
const kcTlsServerNameFileName = 'testdata/tls-server-name-kubeconfig.yaml';
2829

30+
const __dirname = dirname(fileURLToPath(import.meta.url));
31+
2932
use(chaiAsPromised);
3033

3134
/* tslint:disable: no-empty */

src/gcp_auth_test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { expect } from 'chai';
2-
import { join } from 'node:path';
2+
import { dirname, join } from 'node:path';
3+
import { fileURLToPath } from 'node:url';
34

45
import { User, Cluster } from './config_types.js';
56
import { GoogleCloudPlatformAuth } from './gcp_auth.js';
67
import { KubeConfig } from './config.js';
78
import { HttpMethod, RequestContext } from './gen/index.js';
89
import { Agent } from 'node:https';
910

11+
const __dirname = dirname(fileURLToPath(import.meta.url));
12+
1013
describe('GoogleCloudPlatformAuth', () => {
1114
const testUrl1 = 'https://test-gcp.com';
1215
var auth: GoogleCloudPlatformAuth;

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export * from './patch.js';
1515
export * from './metrics.js';
1616
export * from './object.js';
1717
export * from './health.js';
18-
export { ConfigOptions, User, Cluster, Context } from './config_types.js';
18+
export { type ConfigOptions, type User, type Cluster, type Context } from './config_types.js';
1919

2020
// Export FetchError so that instanceof checks in user code will definitely use the same instance
2121
export { FetchError } from 'node-fetch';

src/package_test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import { createRequire } from 'node:module';
12
import { expect } from 'chai';
3+
const require = createRequire(import.meta.url);
24

35
// Generic set of tests to verify the package is built and configured correctly
46
describe('package', () => {

0 commit comments

Comments
 (0)