photoprism/frontend/karma.conf.js

67 lines
1.7 KiB
JavaScript
Raw Normal View History

const path = require("path");
const findChrome = require("chrome-finder");
process.env.CHROME_BIN = findChrome();
module.exports = (config) => {
config.set({
frameworks: ["mocha"],
browsers: ["LocalChrome"],
2019-05-07 15:41:33 +02:00
customLaunchers: {
LocalChrome: {
base: "ChromeHeadless",
flags: ["--disable-translate", "--disable-extensions", "--no-sandbox", "--disable-web-security", "--disable-dev-shm-usage"],
},
2019-05-07 15:41:33 +02:00
},
files: [
{pattern: "tests/unit/**/*_test.js", watched: false},
],
// Preprocess through webpack
preprocessors: {
"tests/unit/**/*_test.js": ["webpack"],
},
reporters: ["progress", "html"],
htmlReporter: {
2019-05-20 20:06:26 +02:00
outputFile: "tests/unit.html",
},
webpack: {
mode: "development",
2019-05-07 15:41:33 +02:00
resolve: {
modules: [
path.join(__dirname, "src"),
path.join(__dirname, "node_modules"),
path.join(__dirname, "tests/unit"),
],
alias: {
vue: "vue/dist/vue.js",
},
},
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader",
2019-05-07 15:41:33 +02:00
exclude: file => (
/node_modules/.test(file)
),
query: {
presets: ["@babel/preset-env"],
compact: false,
},
},
],
},
},
singleRun: true,
});
2019-05-07 15:41:33 +02:00
};