docker/test/test.ts

35 lines
1.2 KiB
TypeScript
Raw Normal View History

2017-03-26 11:02:20 +00:00
import "typings-global";
2016-07-31 20:47:22 +00:00
import { Dockersock } from "../dist/index";
2017-03-26 11:02:20 +00:00
import { expect, tap } from 'tapbundle'
2016-06-15 23:56:53 +00:00
2017-03-26 11:02:20 +00:00
tap.test("dockersock", function () {
tap.test(function () {
2016-07-31 20:47:22 +00:00
let testDockersock: Dockersock;
2017-03-26 11:02:20 +00:00
tap.ok(function () {
2016-06-15 23:56:53 +00:00
testDockersock = new Dockersock();
testDockersock.should.be.instanceof(Dockersock);
2017-03-26 11:02:20 +00:00
}, "should create a new Dockersock instance");
tap.ok("should list containers", function (done) {
2016-06-16 02:18:10 +00:00
testDockersock.listContainers()
2016-07-31 20:47:22 +00:00
.then((dataArg) => {
2016-06-16 02:18:10 +00:00
console.log(dataArg);
done();
});
});
2017-03-26 11:02:20 +00:00
tap.ok(function (done) {
2016-06-16 02:18:10 +00:00
testDockersock.listContainersDetailed()
2016-07-31 20:47:22 +00:00
.then((dataArg) => {
2016-06-16 02:18:10 +00:00
console.log(dataArg);
done();
});
2017-03-26 11:02:20 +00:00
}, "should list detailed containers");
tap.ok(function () {
return testDockersock.pullImage("hosttoday/ht-docker-dbase")
}, "should pull an image from imagetag");
tap.ok(function (done) {
testDockersock.getChangeObservable();
testDockersock.endRequests();
done();
2017-03-26 11:02:20 +00:00
}, "should return a change Objservable")
2016-06-15 23:56:53 +00:00
});
});