make tests work again
This commit is contained in:
+5
-3
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -239,4 +239,3 @@ describe('Provision', function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user