make tests work again

This commit is contained in:
Girish Ramakrishnan
2023-08-14 11:08:38 +05:30
parent 4acbb7136a
commit 4b1b38be63
6 changed files with 10 additions and 9 deletions
+5 -3
View File
@@ -22,6 +22,7 @@ const assert = require('assert'),
dashboard = require('./dashboard.js'),
database = require('./database.js'),
debug = require('debug')('box:oidc'),
dns = require('./dns.js'),
ejs = require('ejs'),
express = require('express'),
eventlog = require('./eventlog.js'),
@@ -791,9 +792,10 @@ async function start() {
}
};
const { fqdn:dashboardFqdn } = await dashboard.getLocation();
debug(`start: create provider for ${dashboardFqdn} at ${ROUTE_PREFIX}`);
const provider = new Provider(`https://${dashboardFqdn}${ROUTE_PREFIX}`, configuration);
const { subdomain, domain } = await dashboard.getLocation();
const fqdn = dns.fqdn(subdomain, domain);
debug(`start: create provider for ${fqdn} at ${ROUTE_PREFIX}`);
const provider = new Provider(`https://${fqdn}${ROUTE_PREFIX}`, configuration);
app.enable('trust proxy');
provider.proxy = true;
+1 -1
View File
@@ -12,7 +12,7 @@ const common = require('./common.js'),
timers = require('timers/promises'),
tokens = require('../../tokens.js');
describe('REST API', function () {
describe('API', function () {
const { setup, cleanup, serverUrl, owner, user } = common;
before(setup);
+1 -1
View File
@@ -10,7 +10,7 @@ const constants = require('../../constants.js'),
expect = require('expect.js'),
superagent = require('superagent');
describe('Cloudron API', function () {
describe('Cloudron', function () {
const { setup, cleanup, serverUrl, owner, user, dashboardFqdn } = common;
before(setup);
+2 -2
View File
@@ -59,10 +59,10 @@ exports = module.exports = {
};
async function setupServer() {
await database._clear();
await oidc.stop();
await database.initialize();
await database._clear();
await appstore._setApiServerOrigin(exports.mockApiServerOrigin);
await oidc.stop();
await server.start();
}
-1
View File
@@ -239,4 +239,3 @@ describe('Provision', function () {
});
});
});
+1 -1
View File
@@ -15,7 +15,7 @@ const constants = require('../../constants.js'),
safe = require('safetydance'),
superagent = require('superagent');
describe('Cloudron API', function () {
describe('System', function () {
const { setup, cleanup, serverUrl, owner, user, waitForTask } = common;
before(setup);