Skip to content

Commit

Permalink
Move Karma stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
chgeo committed Nov 29, 2024
1 parent 431bba6 commit afe7c45
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 68 deletions.
File renamed without changes.
34 changes: 34 additions & 0 deletions app/.karma/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const puppeteer = require("puppeteer"),
cap = require("./karma-cap-middleware");

process.env.CHROME_BIN = puppeteer.executablePath();

module.exports = async (config) => {
// start the CAP server (either specify CLI arg --server=node or --server=java)
let capMiddleware;
if (config.server === "node") {
capMiddleware = cap.node();
} else if (config.server === "java") {
capMiddleware = cap.java();
} else {
throw new Error(`Unknown server type: ${config.server}`);
}

config.set({
frameworks: ["ui5"],
preprocessors: {
"webapp/**/*.ts": ["ui5-transpile"],
},
logLevel: "INFO", // log errors only. Change to "DEBUG" for more verbosity
proxies: {
"/base/webapp/": "/",
},
ui5: {
failOnEmptyTestPage: true,
},
plugins: [...config.plugins, await capMiddleware],
middleware: ["cap-proxy"],
browsers: config.ci ? ["ChromeHeadless"] : ["Chrome"],
singleRun: config.ci || config.singleRun || false
});
};
35 changes: 1 addition & 34 deletions app/travel_analytics/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,34 +1 @@
const puppeteer = require("puppeteer"),
cap = require("../../karma-cap-middleware");

process.env.CHROME_BIN = puppeteer.executablePath();

module.exports = async (config) => {
// start the CAP server (either specify CLI arg --server=node or --server=java)
let capMiddleware;
if (config.server === "node") {
capMiddleware = cap.node();
} else if (config.server === "java") {
capMiddleware = cap.java();
} else {
throw new Error(`Unknown server type: ${config.server}`);
}

config.set({
frameworks: ["ui5"],
preprocessors: {
"webapp/**/*.ts": ["ui5-transpile"],
},
logLevel: "INFO", // log errors only. Change to "DEBUG" for more verbosity
proxies: {
"/base/webapp/": "/",
},
ui5: {
failOnEmptyTestPage: true,
},
plugins: [...config.plugins, await capMiddleware],
middleware: ["cap-proxy"],
browsers: config.ci ? ["ChromeHeadless"] : ["Chrome"],
singleRun: config.ci || config.singleRun || false
});
};
module.exports = require("../.karma/karma.conf.js")
35 changes: 1 addition & 34 deletions app/travel_processor/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,34 +1 @@
const puppeteer = require("puppeteer"),
cap = require("../../karma-cap-middleware");

process.env.CHROME_BIN = puppeteer.executablePath();

module.exports = async (config) => {
// start the CAP server (either specify CLI arg --server=node or --server=java)
let capMiddleware;
if (config.server === "node") {
capMiddleware = cap.node();
} else if (config.server === "java") {
capMiddleware = cap.java();
} else {
throw new Error(`Unknown server type: ${config.server}`);
}

config.set({
frameworks: ["ui5"],
preprocessors: {
"webapp/**/*.ts": ["ui5-transpile"],
},
logLevel: "INFO", // log errors only. Change to "DEBUG" for more verbosity
proxies: {
"/base/webapp/": "/",
},
ui5: {
failOnEmptyTestPage: true,
},
plugins: [...config.plugins, await capMiddleware],
middleware: ["cap-proxy"],
browsers: config.ci ? ["ChromeHeadless"] : ["Chrome"],
singleRun: config.ci || config.singleRun || false
});
};
module.exports = require("../.karma/karma.conf.js")

0 comments on commit afe7c45

Please sign in to comment.