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:
parent
4c8439206e
commit
4e02e4439d
4 changed files with 40 additions and 9 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue