2016-06-21 18:02:57 +00:00
|
|
|
import "typings-test";
|
|
|
|
import "should";
|
|
|
|
import {Qenv} from "qenv";
|
|
|
|
|
2016-06-22 11:22:09 +00:00
|
|
|
import {startInstall} from "../dist/install";
|
|
|
|
import * as cert from "../dist/index";
|
|
|
|
|
|
|
|
|
2016-06-21 19:08:04 +00:00
|
|
|
let testQenv = new Qenv(process.cwd(), process.cwd() + "/.nogit");
|
|
|
|
|
2016-06-22 11:22:09 +00:00
|
|
|
let testCert:cert.Cert;
|
|
|
|
|
|
|
|
describe("cert",function(){
|
|
|
|
describe("install",function(){
|
|
|
|
it("should download letsencrypt.sh",function(done){
|
|
|
|
this.timeout(5000);
|
|
|
|
startInstall().then(() => {
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
describe("Cert",function(){
|
2016-06-22 11:55:38 +00:00
|
|
|
it("should create a new Cert object from class",function(){
|
2016-06-22 11:22:09 +00:00
|
|
|
testCert = new cert.Cert({
|
|
|
|
cfEmail: process.env.CF_EMAIL,
|
|
|
|
cfKey: process.env.CF_KEY,
|
|
|
|
sslDir: ""
|
|
|
|
});
|
|
|
|
testCert.should.be.instanceof(cert.Cert);
|
|
|
|
})
|
|
|
|
it("should get a valid certificate",function(done){
|
|
|
|
this.timeout(120000);
|
2016-06-22 11:35:15 +00:00
|
|
|
testCert.getDomainCert("sub3.bleu.de").then(() => {
|
2016-06-22 11:22:09 +00:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
});
|