photoprism/frontend/karma.conf.js

66 lines
1.7 KiB
JavaScript
Raw Normal View History

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