fix(core): update

This commit is contained in:
2019-01-09 12:15:28 +01:00
parent 1049920efd
commit ede884930e
12 changed files with 316 additions and 142 deletions

View File

@ -4,7 +4,6 @@ import path = require('path');
import { Qenv } from 'qenv';
let testQenv = new Qenv(process.cwd(), path.join(process.cwd(), '.nogit'));
import * as smartnginx from '../ts';
let testSmartNginx: smartnginx.SmartNginx;
@ -12,26 +11,30 @@ let testNginxZone01: smartnginx.NginxHost;
let testNginxZone02: smartnginx.NginxHost;
tap.test('should create a valid instance of SmartNginx', async () => {
testSmartNginx = new smartnginx.SmartNginx();
testSmartNginx = new smartnginx.SmartNginx({});
expect(testSmartNginx).to.be.instanceof(smartnginx.SmartNginx);
});
tap.test(`should produce an instance of NginxConfig`, async () => {
testNginxZone01 = new smartnginx.NginxHost(testSmartNginx, {
hostName: 'test100.bleu.de',
destination: '192.192.192.191'
destination: '192.192.192.191',
privateKey: 'some private',
publicKey: 'some public'
});
testNginxZone02 = new smartnginx.NginxHost(testSmartNginx, {
hostName: 'test102.bleu.de',
destination: '192.192.192.192'
destination: '192.192.192.192',
privateKey: 'some private',
publicKey: 'some public'
});
expect(testNginxZone01).to.be.instanceof(smartnginx.NginxHost);
console.log(testNginxZone01.configString);
});
tap.test('.addZone() should add a zone to NginxConfig Object', async () => {
testSmartNginx.addHost('test200.bleu.de', '192.192.192.191');
testSmartNginx.addHost('test201.blue.de', '192.192.192.191');
testSmartNginx.addHost(testNginxZone01);
testSmartNginx.addHost(testNginxZone02);
});
tap.test('.deploy() should deploy a config from an instance', async () => {