docker/test/test.ts

31 lines
896 B
TypeScript
Raw Normal View History

2018-07-16 21:52:50 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
import { DockerHost } from '../ts/index';
2017-04-02 10:05:29 +00:00
2018-07-16 21:52:50 +00:00
let testDockerHost: DockerHost;
2017-04-02 10:05:29 +00:00
2018-07-16 21:52:50 +00:00
tap.test('should create a new Dockersock instance', async () => {
testDockerHost = new DockerHost();
return expect(testDockerHost).to.be.instanceof(DockerHost);
});
2017-04-02 10:05:29 +00:00
2018-07-16 21:52:50 +00:00
tap.test('should list containers', async () => {
const containers = await testDockerHost.getContainers();
console.log(containers);
});
2017-04-02 10:05:29 +00:00
2019-01-09 23:24:35 +00:00
tap.skip.test('should pull an image from imagetag', async () => {
// await testDockerHost.pullImage('hosttoday/ht-docker-node:npmci');
2018-07-16 21:52:50 +00:00
});
2017-04-02 10:05:29 +00:00
2019-01-09 23:24:35 +00:00
tap.test('should return a change Objservable', async (tools) => {
const testObservable = await testDockerHost.getEventObservable();
const subscription = testObservable.subscribe(changeObject => {
console.log(changeObject);
});
await tools.delayFor(2000);
subscription.unsubscribe();
});
2017-04-02 10:05:29 +00:00
2018-07-16 21:52:50 +00:00
tap.start();