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
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
This repository contains an alternative web frontend for [airsonic](https://github.com/airsonic/airsonic). The goal is to eventually be able to fully replace the current web interface.
|
||||
|
||||
## Implemented so far
|
||||
## Implemented So Far
|
||||
|
||||
* Login with persisting credentials
|
||||
* Browse your library by newest / most recently played / starred
|
||||
|
|
@ -39,7 +39,7 @@ $ npm run dev
|
|||
|
||||
All other build tasks are defined in the `package.json` (more below).
|
||||
|
||||
### Editor integration
|
||||
### Editor Integration
|
||||
|
||||
Integrating shadow-cljs with your editor helps tremendously with development. After having run `npm run dev` as described above you can connect to the REPL and get features like in-editor code execution and code completion / documentation lookup. For further information see [this part of the shadow-cljs user guide](https://shadow-cljs.github.io/docs/UsersGuide.html#_editor_integration). Recommended editors and plugins are Calva for VSCode and CIDER for Emacs (comes with Spacemacs). Make sure to open `localhost:8080` in the browser after starting the `dev:cljs` task to execute ClojureScript code in a live REPL.
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ It provides you with tools to inspect the state of the application, undo and rep
|
|||
|
||||
## Tests
|
||||
|
||||
This project uses [karma](https://karma-runner.github.io/) for tests. Make sure to have Google Chrome installed, otherwise the watcher will time out.
|
||||
This project uses [karma](https://karma-runner.github.io/) for tests. There is a check inside `karma.conf.js` to see whether Firefox is installed (via `which firefox` which probably breaks on Windows 🤷); if that command doesn't fail it will be used as the test runner. Otherwise Chrome will be used. If you have Chromium installed, make sure to set the `CHROME_BIN` environment variable to point to Chromium.
|
||||
|
||||
```
|
||||
# run tests once
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
17
package-lock.json
generated
17
package-lock.json
generated
|
|
@ -4004,6 +4004,23 @@
|
|||
"integrity": "sha1-y4YF7w4R+ab20o9Wul298m84mSM=",
|
||||
"dev": true
|
||||
},
|
||||
"karma-firefox-launcher": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-1.2.0.tgz",
|
||||
"integrity": "sha512-j9Zp8M8+VLq1nI/5xZGfzeaEPtGQ/vk3G+Y8vpmFWLvKLNZ2TDjD6cu2dUu7lDbu1HXNgatsAX4jgCZTkR9qhQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-wsl": "^2.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-wsl": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.1.1.tgz",
|
||||
"integrity": "sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"karma-notify-reporter": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/karma-notify-reporter/-/karma-notify-reporter-1.1.0.tgz",
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
"karma": "^4.0.1",
|
||||
"karma-chrome-launcher": "^3.0.0",
|
||||
"karma-cljs-test": "^0.1.0",
|
||||
"karma-firefox-launcher": "^1.2.0",
|
||||
"karma-notify-reporter": "^1.1.0",
|
||||
"node-sass": "^4.11.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue