Skip to content

Commit

Permalink
make travis run all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maraoz committed Nov 26, 2014
1 parent dcfedce commit 2565181
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
language: node_js
node_js:
- '0.10'
notifications:
hipchat:
rooms:
secure: p6IUoOsKoM7cEmUsYh9JV5XKpUSASXukGkiBxdPU+ELM1CgNT0PyUROXwgDvI0vjSBCJemNh5sqrEQWiT70PcR69rH1JQ6+mHZah4r6W1Ql0NuWibvsofLyCeTzW2nrptdx97Z4y65NiHsaaOo3F+BShTeBpmBAvRMNp/FLMjWU=
template:
- '%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message} (<a href="%{build_url}">Details</a>/<a href="%{compare_url}">Change view</a>)'
format: html
on_success: never
before_install:
- npm install -g bower
- npm install -g grunt-cli
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
install:
- bower install
- npm install

33 changes: 24 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,23 @@ function ignoreError() {
/* jshint ignore:end */
}

function testMocha() {
return gulp.src(tests).pipe(new mocha({reporter: 'spec'}));
}
var testMocha = function() {
return gulp.src(tests).pipe(new mocha({
reporter: 'spec'
}));
};

var testKarma = shell.task([
'./node_modules/karma/bin/karma start --single-run --browsers Firefox'
]);


gulp.task('test', testMocha);

gulp.task('test-all', function(callback) {
runSequence(['test'], ['karma'], callback);
});

gulp.task('test-nofail', function() {
return testMocha().on('error', ignoreError);
});
Expand All @@ -55,6 +66,10 @@ gulp.task('watch:lint', function() {
return gulp.watch(alljs, ['lint']);
});

gulp.task('watch:browser', function() {
return gulp.watch(alljs, ['browser', 'browser-test']);
});

gulp.task('coverage', shell.task(['istanbul cover _mocha -- --recursive']));

gulp.task('jsdoc', function() {
Expand All @@ -81,13 +96,13 @@ gulp.task('browser', function() {
.pipe(gulp.dest('browser'));
});

gulp.task('browser-test', shell.task([
'find test/ -type f -name "*.js" | xargs browserify -o ./browser/tests.js'
]));
gulp.task('browser-test', function() {
shell.task([
'find test/ -type f -name "*.js" | xargs browserify -o ./browser/tests.js'
]);
});

gulp.task('karma', shell.task([
'./node_modules/karma/bin/karma start karma.conf.js'
]));
gulp.task('karma', testKarma);

gulp.task('minify', function() {
return gulp.src('dist/bitcore.js')
Expand Down
4 changes: 4 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
'use strict';

// karma.conf.js
module.exports = function(config) {
config.set({
frameworks: ['mocha'],
browsers: ['Chrome', 'Firefox'],
singleRun: true,
files: [
'browser/tests.js'
]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "index.js",
"scripts": {
"lint": "gulp lint",
"test": "gulp test",
"test": "gulp test-all",
"coverage": "gulp coverage",
"build": "gulp"
},
Expand Down

0 comments on commit 2565181

Please sign in to comment.