+++ /dev/null
-'use strict'
-
-if(process.platform === 'linux') {
- const child_process = require('child_process')
- const exec = child_process.exec
- const execSync = bind2(child_process.execSync, { encoding: 'utf8' })//spawnSync
- const browsers = ['google-chrome', 'chromium-browser']
-
- const findBrowser = msg => {
- console.log(msg)
- const browserString = /\/(.*)$/
- const browser = msg.match(browserString)
- console.log(browsers)
- if(browsers[browser]) browsers[browser] = true
- }
-
- const tryCompose = (f, parameter) => {
- //FIXME:
- const x = f.splice(0, 1)[0]
- if(Array.isArray(f) && f.length > 0) return tryCompose(f, parameter)
- //
-
- try {
- return x(parameter)
- }
- catch(e) {
- console.warn(e.message)
- }
- }
-
- tryCompose([findBrowser, execSync], 'which google-chrome')
- //findBrowser(execSync('which chromium-browser'))
-
- if(browsers[0]) return
- if(!browsers[0] && browsers[1]) exec('export CHROME_BIN=chromium-browser')
- if(browsers.every(b => !b)) console.warn('You need to install either Chrome or Chromium to run the test suite.')
-
-}
-
-function bind2(f, bound) {
- return (parameter) => f(parameter, bound)
-}
\ No newline at end of file
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
- browsers: ['Chrome'],
-
-
- customLaunchers: {
- Chrome_travis_ci: {
- base: 'Chrome',
- flags: ['--no-sandbox']
- }
- },
-
+ browsers: ['Firefox'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
// how many browser should be started simultaneous
concurrency: Infinity
})
-
- if(process.env.TRAVIS){
- config.browsers = ['Chrome_travis_ci'];
- }
}
node_js:
- "node"
script: npm test
-#sudo: true
+sudo: true
before_install:
- - export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- #- sudo apt-get -qq update
- #- sudo apt-get install -y chromium-browser
+ - sudo apt-get -qq update
+ - sudo apt-get install -y firefox
"typings": "./svg.js.d.ts",
"scripts": {
"build": "gulp",
- "pretest": "node .config/chrome_linux.js",
"test": "karma start .config/karma.conf.js --single-run"
},
"devDependencies": {
"gulp-wrap": "^0.13.0",
"jasmine-core": "^2.5.2",
"karma": "^1.3.0",
- "karma-chrome-launcher": "^2.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
"request": "^2.75.0"