Skip to content

Commit

Permalink
handle exported interfaces and CJS artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig committed Dec 5, 2024
1 parent 8d4373a commit 2d98554
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/azure_auth_test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { use, expect } from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { join } from 'node:path';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';

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

const __dirname = dirname(fileURLToPath(import.meta.url));

use(chaiAsPromised);

describe('AzureAuth', () => {
Expand Down
5 changes: 4 additions & 1 deletion src/config_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { readFileSync } from 'node:fs';
import https from 'node:https';
import { Agent, RequestOptions } from 'node:https';
import path, { join } from 'node:path';
import path, { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';

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

const __dirname = dirname(fileURLToPath(import.meta.url));

use(chaiAsPromised);

/* tslint:disable: no-empty */
Expand Down
5 changes: 4 additions & 1 deletion src/gcp_auth_test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { expect } from 'chai';
import { join } from 'node:path';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';

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

const __dirname = dirname(fileURLToPath(import.meta.url));

describe('GoogleCloudPlatformAuth', () => {
const testUrl1 = 'https://test-gcp.com';
var auth: GoogleCloudPlatformAuth;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export * from './patch.js';
export * from './metrics.js';
export * from './object.js';
export * from './health.js';
export { ConfigOptions, User, Cluster, Context } from './config_types.js';
export { type ConfigOptions, type User, type Cluster, type Context } from './config_types.js';

// Export FetchError so that instanceof checks in user code will definitely use the same instance
export { FetchError } from 'node-fetch';
2 changes: 2 additions & 0 deletions src/package_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { createRequire } from 'node:module';
import { expect } from 'chai';
const require = createRequire(import.meta.url);

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

0 comments on commit 2d98554

Please sign in to comment.