diff options
-rw-r--r-- | .config/chrome_linux.js | 42 | ||||
-rw-r--r-- | .config/karma.conf.js | 15 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | .travis.yml | 7 | ||||
-rw-r--r-- | package.json | 2 |
5 files changed, 6 insertions, 63 deletions
diff --git a/.config/chrome_linux.js b/.config/chrome_linux.js deleted file mode 100644 index 5820a19..0000000 --- a/.config/chrome_linux.js +++ /dev/null @@ -1,42 +0,0 @@ -'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 diff --git a/.config/karma.conf.js b/.config/karma.conf.js index 2a7dae4..ad256e2 100644 --- a/.config/karma.conf.js +++ b/.config/karma.conf.js @@ -65,16 +65,7 @@ module.exports = function(config) { // 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 @@ -84,8 +75,4 @@ module.exports = function(config) { // how many browser should be started simultaneous concurrency: Infinity }) - - if(process.env.TRAVIS){ - config.browsers = ['Chrome_travis_ci']; - } } @@ -7,4 +7,5 @@ docs/ obsolete/ test/ src/index.js -node_modules/
\ No newline at end of file +node_modules/ +.vscode/
\ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 437623d..9c2e44a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,9 @@ language: node_js 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 diff --git a/package.json b/package.json index cee6ee6..bfc3052 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,6 @@ "typings": "./svg.js.d.ts", "scripts": { "build": "gulp", - "pretest": "node .config/chrome_linux.js", "test": "karma start .config/karma.conf.js --single-run" }, "devDependencies": { @@ -67,7 +66,6 @@ "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" |