docker/test/test.ts

42 lines
1.4 KiB
TypeScript
Raw Normal View History

2016-06-15 23:56:53 +00:00
import "typings-test";
2016-07-11 15:44:02 +00:00
import "should";
2016-06-15 23:56:53 +00:00
2016-07-31 20:47:22 +00:00
import { Dockersock } from "../dist/index";
2016-06-15 23:56:53 +00:00
2016-07-31 20:47:22 +00:00
describe("dockersock", function () {
describe(".Dockersock()", function () {
let testDockersock: Dockersock;
it("should create a new Dockersock instance", function () {
2016-06-15 23:56:53 +00:00
testDockersock = new Dockersock();
testDockersock.should.be.instanceof(Dockersock);
});
2016-07-31 20:47:22 +00:00
it("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();
});
});
2016-07-31 20:47:22 +00:00
it("should list detailed containers", function (done) {
2016-06-16 02:18:10 +00:00
this.timeout(5000);
testDockersock.listContainersDetailed()
2016-07-31 20:47:22 +00:00
.then((dataArg) => {
2016-06-16 02:18:10 +00:00
console.log(dataArg);
done();
});
});
2016-07-31 20:47:22 +00:00
it("should pull an image from imagetag", function (done) {
2016-07-11 15:44:02 +00:00
this.timeout(60000);
2016-07-17 22:54:41 +00:00
testDockersock.pullImage("hosttoday/ht-docker-dbase")
2016-07-31 20:47:22 +00:00
.then((dataArg) => {
2016-06-16 06:47:21 +00:00
done();
});
});
2016-07-31 20:47:22 +00:00
it("should return a change Objservable", function (done) {
this.timeout(10000);
testDockersock.getChangeObservable();
testDockersock.endRequests();
done();
2016-06-16 06:47:21 +00:00
})
2016-06-15 23:56:53 +00:00
});
});