smartnginx/test/test.ts

37 lines
1.4 KiB
TypeScript
Raw Normal View History

2016-07-06 01:14:44 +00:00
import "typings-test";
import "should";
2016-07-06 04:33:31 +00:00
import * as smartnginx from "../dist/index";
describe("smartnginx",function(){
let testNginxConfig:smartnginx.NginxConfig;
let testNginxZone01:smartnginx.NginxZone;
2016-07-06 06:30:33 +00:00
let testNginxZone02:smartnginx.NginxZone;
describe("NginxZone",function(){
it(`"new NginxZone()" should produce an instance of NginxConfig`,function(){
testNginxZone01 = new smartnginx.NginxZone({
zoneName:"test1.bleu.de",
type:smartnginx.zoneTypes.reverseProxy,
destination:"192.192.192.192"
});
testNginxZone01.should.be.instanceof(smartnginx.NginxZone);
console.log(testNginxZone01.configString);
});
});
2016-07-06 04:33:31 +00:00
describe("NginxConfig",function(){
it(`"new NginxConfig()" should produce an instance of NginxConfig`,function(){
testNginxConfig = new smartnginx.NginxConfig();
testNginxConfig.should.be.instanceof(smartnginx.NginxConfig);
2016-07-08 02:24:07 +00:00
});
describe(".addZone()",function(){
it("should add a zone to NginxConfig Object",function(){
testNginxConfig.addZone(testNginxZone01);
})
});
describe(".deploy()",function(){
it("should deploy a config from an instance",function(){
testNginxConfig.deploy();
})
});
2016-07-06 06:30:33 +00:00
});
2016-07-06 04:33:31 +00:00
});