1
0
Fork 0
mirror of https://github.com/heyarne/airsonic-ui.git synced 2026-05-06 10:23:39 +02:00

Remove chromium dependency for tests (#73)

This commit is contained in:
heyarne 2019-12-21 11:43:38 +01:00 committed by GitHub
commit 4e02e4439d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 9 deletions

View file

@ -1,6 +1,23 @@
const { execSync } = require('child_process')
module.exports = function (config) {
let browsers = null;
if (process.env.TRAVIS || process.env.CI) {
// custom config for continuous integration
browsers = ['ChromeHeadlessCI']
} else {
try {
// if Firefox is installed, use that as the test runner
execSync('which firefox')
browsers = ['FirefoxHeadless']
} catch (_) {
browsers = ['ChromeHeadless']
}
}
const configuration = {
browsers: ['ChromeHeadless'],
browsers: browsers,
// The tests are sometimes run before the tests were completely written
// to disc; this is a known problem unfortunately. This is a hack to at
// least keep the browsers connected so the tests are compiled and run
@ -15,6 +32,7 @@ module.exports = function (config) {
plugins: [
'karma-cljs-test',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-notify-reporter' // reporters are set in package.json
],
colors: true,
@ -31,10 +49,5 @@ module.exports = function (config) {
}
}
if (process.env.TRAVIS || process.env.CI) {
configuration.browsers = ['ChromeHeadlessCI']
}
config.set(configuration)
}