smartcert/test/test.ts

46 lines
1.5 KiB
TypeScript
Raw Normal View History

2016-06-21 18:02:57 +00:00
import "typings-test";
import "should";
import {Qenv} from "qenv";
2016-06-28 07:32:01 +00:00
import path = require("path");
2016-07-21 12:58:05 +00:00
import q = require("q");
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(){
it("should create a new Cert object from class",function(){
2016-07-13 14:06:16 +00:00
this.timeout(40000);
2016-06-22 11:22:09 +00:00
testCert = new cert.Cert({
cfEmail: process.env.CF_EMAIL,
cfKey: process.env.CF_KEY,
2016-07-04 02:56:49 +00:00
sslDir: path.join(process.cwd(),"test/assets"),
2016-07-04 06:41:58 +00:00
gitOriginRepo:"git@gitlab.com:sandboxzone/sandbox-sslorigin.git",
testMode:true
2016-06-22 11:22:09 +00:00
});
testCert.should.be.instanceof(cert.Cert);
})
it("should get a valid certificate",function(done){
this.timeout(120000);
2016-07-21 12:58:05 +00:00
let promiseArray = [];
promiseArray.push(testCert.getDomainCert("testing1.bleu.de"));
//promiseArray.push(testCert.getDomainCert("testing2.bleu.de"));
//promiseArray.push(testCert.getDomainCert("testing3.bleu.de"));
q.all(promiseArray).then(() => {
2016-06-22 11:22:09 +00:00
done();
});
})
})
});