kubernetes/test/test.ts

35 lines
755 B
TypeScript
Raw Normal View History

2020-01-15 14:08:06 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
import * as kubernetes from '../ts/index';
2020-01-19 10:57:41 +00:00
let testClient: kubernetes.KubeClient;
2020-01-18 18:47:46 +00:00
2020-01-25 18:23:18 +00:00
if (process.env.CI) {
process.exit(0);
}
2020-01-15 14:08:06 +00:00
tap.test('first test', async () => {
2020-01-19 10:57:41 +00:00
testClient = new kubernetes.KubeClient();
2020-01-15 14:08:06 +00:00
});
2020-01-19 10:57:41 +00:00
tap.test('should init the client', async () => {
await testClient.init();
2020-01-25 18:52:46 +00:00
});
2020-01-19 10:57:41 +00:00
tap.test('should be able to set a certificate', async () => {
await testClient.setSslSecret('central.eu', {
created: 123456,
csr: '',
domainName: '*.central.eu',
id: 'hu7e6rw',
privateKey: 'wowza',
publicKey: 'hellothere'
2020-01-25 18:52:46 +00:00
});
});
2020-01-19 10:57:41 +00:00
tap.test('should get a secret', async () => {
2020-01-25 18:52:46 +00:00
const result = await testClient.getSslSecret('central.eu');
2020-01-19 10:57:41 +00:00
console.log(result);
2020-01-25 18:52:46 +00:00
});
2020-01-19 10:57:41 +00:00
2020-01-15 14:08:06 +00:00
tap.start();