now creating a valid config with ssl certificates

This commit is contained in:
LosslessBot
2016-07-13 13:04:48 +02:00
parent 92307b187d
commit 2caa3c3d1a
11 changed files with 166 additions and 18 deletions

View File

@@ -1,7 +1,13 @@
import "typings-test";
import path = require("path");
import "should";
import {Qenv} from "qenv";
import * as smartnginx from "../dist/index";
// setup environment
let testQenv = new Qenv(process.cwd(),path.join(process.cwd(),".nogit"));
console.log(process.env.CF_EMAIL);
console.log(process.env.CF_KEY);
describe("smartnginx",function(){
let testNginxConfig:smartnginx.NginxConfig;
let testNginxZone01:smartnginx.NginxZone;
@@ -9,7 +15,7 @@ describe("smartnginx",function(){
describe("NginxZone",function(){
it(`"new NginxZone()" should produce an instance of NginxConfig`,function(){
testNginxZone01 = new smartnginx.NginxZone({
zoneName:"test1.bleu.de",
zoneName:"test100.bleu.de",
type:smartnginx.zoneTypes.reverseProxy,
destination:"192.192.192.192"
});
@@ -19,7 +25,11 @@ describe("smartnginx",function(){
});
describe("NginxConfig",function(){
it(`"new NginxConfig()" should produce an instance of NginxConfig`,function(){
testNginxConfig = new smartnginx.NginxConfig();
testNginxConfig = new smartnginx.NginxConfig({
cfEmail: process.env.CF_EMAIL,
cfKey: process.env.CF_KEY,
testMode:true
});
testNginxConfig.should.be.instanceof(smartnginx.NginxConfig);
});
describe(".addZone()",function(){
@@ -28,8 +38,12 @@ describe("smartnginx",function(){
})
});
describe(".deploy()",function(){
it("should deploy a config from an instance",function(){
testNginxConfig.deploy();
this.timeout(240000);
it("should deploy a config from an instance",function(done){
testNginxConfig.deploy()
.then(() => {
done();
});
})
});
});