-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d37f970
commit ef3003f
Showing
8 changed files
with
132 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
language: node_js | ||
node_js: | ||
- "stable" | ||
|
||
sudo: false | ||
|
||
notifications: | ||
email: false | ||
|
||
cache: | ||
directories: | ||
- node_modules | ||
- jspm_packages | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
install: | ||
- npm install | ||
- jspm config registries.github.auth $JSPM_GITHUB_AUTH_TOKEN | ||
- node_modules/.bin/jspm install | ||
|
||
before_script: | ||
- export CHROME_BIN=chromium-browser | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
|
||
script: | ||
- npm run ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var gulp = require('gulp'); | ||
|
||
gulp.task('ci', ['default', 'coveralls']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var gulp = require('gulp'); | ||
var runSequence = require('run-sequence'); | ||
|
||
gulp.task('default', function(callback) { | ||
return runSequence( | ||
'lint', | ||
'build', | ||
'doc', | ||
'test', | ||
callback | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,34 @@ | ||
var gulp = require('gulp'); | ||
var Karma = require('karma').Server; | ||
var karma = require('karma'); | ||
var coveralls = require('gulp-coveralls'); | ||
|
||
/** | ||
* Run test once and exit | ||
*/ | ||
gulp.task('test', function (done) { | ||
new Karma({ | ||
configFile: __dirname + '/../../karma.conf.js', | ||
singleRun: true | ||
}, done).start(); | ||
new karma.Server({ | ||
configFile: __dirname + '/../../karma.conf.js', | ||
singleRun: true | ||
}, function(e) { | ||
done(e === 0 ? null : 'karma exited with status ' + e); | ||
}).start(); | ||
}); | ||
|
||
/** | ||
* Watch for file changes and re-run tests on each change | ||
*/ | ||
gulp.task('tdd', function (done) { | ||
new Karma({ | ||
configFile: __dirname + '/../../karma.conf.js' | ||
}, done).start(); | ||
new karma.Server({ | ||
configFile: __dirname + '/../../karma.conf.js' | ||
}, function(e) { | ||
done(); | ||
}).start(); | ||
}); | ||
|
||
/** | ||
* Run test once with code coverage and exit | ||
* Report coverage to coveralls | ||
*/ | ||
gulp.task('cover', function (done) { | ||
new Karma({ | ||
configFile: __dirname + '/../../karma.conf.js', | ||
singleRun: true, | ||
reporters: ['coverage'], | ||
preprocessors: { | ||
'test/**/*.js': ['babel'], | ||
'src/**/*.js': ['babel', 'coverage'] | ||
}, | ||
coverageReporter: { | ||
type: 'html', | ||
dir: 'build/reports/coverage' | ||
} | ||
}, done).start(); | ||
gulp.task('coveralls', ['test'], function (done) { | ||
gulp.src('build/reports/coverage/lcov/report-lcovonly.txt') | ||
.pipe(coveralls()); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,81 @@ | ||
// Karma configuration | ||
// Generated on Fri Dec 05 2014 16:49:29 GMT-0500 (EST) | ||
var isparta = require('isparta'); | ||
var paths = require('./build/paths'); | ||
var babelOptions = require('./build/babel-options'); | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
|
||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '', | ||
|
||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
var configuration = { | ||
frameworks: ['jspm', 'jasmine'], | ||
|
||
jspm: { | ||
// Edit this to your needs | ||
loadFiles: ['src/**/*.js', 'test/**/*.js'] | ||
config: 'config.js', | ||
loadFiles: [paths.tests], | ||
serveFiles: [paths.source] | ||
}, | ||
|
||
|
||
// list of files / patterns to load in the browser | ||
files: [], | ||
|
||
|
||
// list of files to exclude | ||
exclude: [ | ||
], | ||
|
||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
'test/**/*.js': ['babel'], | ||
'src/**/*.js': ['babel'] | ||
[paths.tests]: ['babel'], | ||
[paths.source]: ['babel', 'sourcemap', 'coverage'] | ||
}, | ||
'babelPreprocessor': { | ||
|
||
babelPreprocessor: { | ||
options: { | ||
sourceMap: 'inline', | ||
modules: 'system', | ||
moduleIds: false, | ||
loose: "all", | ||
optional: [ | ||
"es7.decorators", | ||
"es7.classProperties" | ||
] | ||
loose: babelOptions.loose, | ||
stage: babelOptions.stage, | ||
optional: babelOptions.optional, | ||
sourceMap: 'inline' | ||
} | ||
}, | ||
|
||
reporters: ['coverage', 'progress'], | ||
|
||
coverageReporter: { | ||
instrumenters: { | ||
isparta: isparta | ||
}, | ||
|
||
instrumenter: { | ||
[paths.source]: 'isparta' | ||
}, | ||
|
||
dir: 'build/reports/coverage/', | ||
|
||
reporters: [{ | ||
type: 'text-summary' | ||
}, { | ||
type: 'html', | ||
subdir: 'html' | ||
}, { | ||
type: 'lcovonly', | ||
subdir: 'lcov', | ||
file: 'report-lcovonly.txt' | ||
}] | ||
}, | ||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
|
||
|
||
// web server port | ||
port: 9876, | ||
|
||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
|
||
customLaunchers: { | ||
Chrome_travis_ci: { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['Chrome'], | ||
|
||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: false | ||
}); | ||
}; | ||
|
||
if (process.env.TRAVIS) { | ||
configuration.browsers = ['Chrome_travis_ci', 'Firefox']; | ||
} | ||
|
||
config.set(configuration); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters