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

@@ -37,29 +37,43 @@ module.exports = function(config) {
], ],
// list of files to exclude // list of files to exclude
exclude: [ ], exclude: [],
/* /*
* list of files / patterns to load in the browser * list of files / patterns to load in the browser
* *
* we are building the test environment in ./spec-bundle.js * 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 * preprocess matching files before serving them to the browser
* available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor * 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 Config at ./webpack.test.js
webpack: testWebpackConfig, webpack: testWebpackConfig,
coverageReporter: { coverageReporter: {
reporters:[ reporters: [
{type: 'in-memory'}, {
{type: 'json', subdir: '.', file: 'coverage-final.json'}, type: 'in-memory'
{type: 'html', dir : 'coverage/'} }, {
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! // Webpack please don't spam the console when running in karma!
webpackMiddleware: { stats: 'errors-only'}, webpackMiddleware: {
stats: 'errors-only'
},
/* /*
* test results reporter to use * test results reporter to use
@@ -84,7 +100,9 @@ module.exports = function(config) {
* possible values: 'dots', 'progress' * possible values: 'dots', 'progress'
* available reporters: https://npmjs.org/browse/keyword/karma-reporter * 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 // Karma web server port
port: 9876, port: 9876,
@@ -134,7 +152,9 @@ module.exports = function(config) {
mochaReporter: { mochaReporter: {
ignoreSkipped: true ignoreSkipped: true
} },
browserNoActivityTimeout: 30000
/* /*
* Continuous Integration mode * Continuous Integration mode
@@ -143,10 +163,8 @@ module.exports = function(config) {
//singleRun: true //singleRun: true
}; };
if (process.env.TRAVIS){ if (process.env.TRAVIS) {
configuration.browsers = [ configuration.browsers = ['ChromeTravisCi'];
'ChromeTravisCi'
];
} }
config.set(configuration); config.set(configuration);