Fix test
This commit is contained in:
parent
e86a155ec2
commit
adab03f730
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
global.log = require("../log.js");
|
global.log = require("../log.js");
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
const program = require("commander");
|
const program = require("commander");
|
||||||
const colors = require("colors/safe");
|
const colors = require("colors/safe");
|
||||||
const Helper = require("../helper");
|
const Helper = require("../helper");
|
||||||
@ -22,6 +24,18 @@ if (program.home) {
|
|||||||
log.warn(`Use the ${colors.green("LOUNGE_HOME")} environment variable instead.`);
|
log.warn(`Use the ${colors.green("LOUNGE_HOME")} environment variable instead.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the app was built before calling setHome as it wants to load manifest.json from the public folder
|
||||||
|
if (!fs.existsSync(path.join(
|
||||||
|
__dirname,
|
||||||
|
"..",
|
||||||
|
"..",
|
||||||
|
"public",
|
||||||
|
"manifest.json"
|
||||||
|
))) {
|
||||||
|
log.error(`The client application was not built. Run ${colors.bold("NODE_ENV=production npm run build")} to resolve this.`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
let home = program.home || process.env.LOUNGE_HOME;
|
let home = program.home || process.env.LOUNGE_HOME;
|
||||||
|
|
||||||
if (!home) {
|
if (!home) {
|
||||||
|
@ -32,11 +32,6 @@ module.exports = function() {
|
|||||||
(Node.js ${colors.green(process.versions.node)} on ${colors.green(process.platform)} ${process.arch})`);
|
(Node.js ${colors.green(process.versions.node)} on ${colors.green(process.platform)} ${process.arch})`);
|
||||||
log.info(`Configuration file: ${colors.green(Helper.CONFIG_PATH)}`);
|
log.info(`Configuration file: ${colors.green(Helper.CONFIG_PATH)}`);
|
||||||
|
|
||||||
if (!fs.existsSync("public/js/bundle.js")) {
|
|
||||||
log.error(`The client application was not built. Run ${colors.bold("NODE_ENV=production npm run build")} to resolve this.`);
|
|
||||||
process.exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
var app = express()
|
var app = express()
|
||||||
.disable("x-powered-by")
|
.disable("x-powered-by")
|
||||||
.use(allRequests)
|
.use(allRequests)
|
||||||
|
@ -23,7 +23,7 @@ describe("Server", () => {
|
|||||||
request(webURL, (error, response, body) => {
|
request(webURL, (error, response, body) => {
|
||||||
expect(error).to.be.null;
|
expect(error).to.be.null;
|
||||||
expect(body).to.include("<title>The Lounge</title>");
|
expect(body).to.include("<title>The Lounge</title>");
|
||||||
expect(body).to.include("https://thelounge.github.io/");
|
expect(body).to.include("js/bundle.js");
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user