reverseproxy: async'ify
This commit is contained in:
@@ -121,15 +121,15 @@ describe('Reverse Proxy', function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe('generateFallbackCertificiate', function () {
|
||||
describe('generateFallbackCertificate', function () {
|
||||
let domainObject = {
|
||||
domain: 'cool.com',
|
||||
config: {}
|
||||
};
|
||||
let result;
|
||||
|
||||
it('can generate fallback certs', function () {
|
||||
result = reverseProxy.generateFallbackCertificateSync(domainObject.domain);
|
||||
it('can generate fallback certs', async function () {
|
||||
result = await reverseProxy.generateFallbackCertificate(domainObject.domain);
|
||||
expect(result).to.be.ok();
|
||||
expect(result.error).to.be(null);
|
||||
});
|
||||
@@ -175,20 +175,14 @@ describe('Reverse Proxy', function () {
|
||||
await domains.update(domainCopy.domain, domainCopy, auditSource);
|
||||
});
|
||||
|
||||
it('configure nginx correctly', function (done) {
|
||||
reverseProxy.configureApp(app, auditSource, function (error) {
|
||||
expect(fs.existsSync(paths.NGINX_APPCONFIG_DIR + '/' + app.id + '.conf'));
|
||||
expect(error).to.be(null);
|
||||
done();
|
||||
});
|
||||
it('configure nginx correctly', async function () {
|
||||
await reverseProxy.configureApp(app, auditSource);
|
||||
expect(fs.existsSync(paths.NGINX_APPCONFIG_DIR + '/' + app.id + '.conf'));
|
||||
});
|
||||
|
||||
it('unconfigure nginx', function (done) {
|
||||
reverseProxy.unconfigureApp(app, function (error) {
|
||||
expect(!fs.existsSync(paths.NGINX_APPCONFIG_DIR + '/' + app.id + '.conf'));
|
||||
expect(error).to.be(null);
|
||||
done();
|
||||
});
|
||||
it('unconfigure nginx', async function () {
|
||||
await reverseProxy.unconfigureApp(app);
|
||||
expect(!fs.existsSync(paths.NGINX_APPCONFIG_DIR + '/' + app.id + '.conf'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user