Merge pull request #80 from wwelling/travis-ci

Travis CI: this connects to #76
This commit is contained in:
Art Lowel
2017-03-24 14:02:17 +01:00
committed by GitHub
2 changed files with 67 additions and 14 deletions

35
.travis.yml Normal file
View File

@@ -0,0 +1,35 @@
sudo: required
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
language: node_js
node_js:
- "6"
- "7"
cache:
yarn: true
directories:
- node_modules
before_install:
- yarn run global
install:
- yarn install
before_script:
- yarn run build
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
script:
- yarn run ci

View File

@@ -44,22 +44,36 @@ module.exports = function(config) {
*
* we are building the test environment in ./spec-bundle.js
*/
files: [ { pattern: './spec-bundle.js', watched: false } ],
files: [
{
pattern: './spec-bundle.js',
watched: false
}
],
/*
* preprocess matching files before serving them to the browser
* available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
*/
preprocessors: { './spec-bundle.js': ['coverage', 'webpack', 'sourcemap'] },
preprocessors: {
'./spec-bundle.js': ['coverage', 'webpack', 'sourcemap']
},
// Webpack Config at ./webpack.test.js
webpack: testWebpackConfig,
coverageReporter: {
reporters: [
{type: 'in-memory'},
{type: 'json', subdir: '.', file: 'coverage-final.json'},
{type: 'html', dir : 'coverage/'}
{
type: 'in-memory'
}, {
type: 'json',
subdir: '.',
file: 'coverage-final.json'
}, {
type: 'html',
dir: 'coverage/'
}
]
},
@@ -76,7 +90,9 @@ module.exports = function(config) {
},
// Webpack please don't spam the console when running in karma!
webpackMiddleware: { stats: 'errors-only'},
webpackMiddleware: {
stats: 'errors-only'
},
/*
* test results reporter to use
@@ -84,7 +100,9 @@ module.exports = function(config) {
* possible values: 'dots', 'progress'
* available reporters: https://npmjs.org/browse/keyword/karma-reporter
*/
reporters: [ 'mocha', 'coverage', 'karma-remap-istanbul' ],
reporters: [
'mocha', 'coverage', 'karma-remap-istanbul'
],
// Karma web server port
port: 9876,
@@ -134,7 +152,9 @@ module.exports = function(config) {
mochaReporter: {
ignoreSkipped: true
}
},
browserNoActivityTimeout: 30000
/*
* Continuous Integration mode
@@ -144,9 +164,7 @@ module.exports = function(config) {
};
if (process.env.TRAVIS) {
configuration.browsers = [
'ChromeTravisCi'
];
configuration.browsers = ['ChromeTravisCi'];
}
config.set(configuration);