diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f731819 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +sudo: false +before_script: + - npm install -g bower + - bower install +language: node_js +node_js: + - iojs + - '0.12' + - '0.10' +matrix: + allow_failures: + - node_js: iojs diff --git a/gulpfile.js b/gulpfile.js index f8b36e4..7a145db 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,6 +2,7 @@ 'use strict'; // generated on 2015-05-02 using generator-gulp-webapp 0.3.0 var gulp = require('gulp'); +var mocha = require('gulp-mocha'); var $ = require('gulp-load-plugins')(); var browserSync = require('browser-sync'); var reload = browserSync.reload; @@ -67,8 +68,26 @@ gulp.task('extras', function () { }).pipe(gulp.dest('dist')); }); +gulp.task('mocha', function () { + return gulp.src('./test/*.js') + .pipe(mocha({ reporter: 'list' })); +}); + gulp.task('clean', require('del').bind(null, ['.tmp', 'dist'])); +var dist_port = process.env.PORT || 6174; +gulp.task('serve:dist', ['default'], function () { + browserSync({ + notify: false, + // Run as an https by uncommenting 'https: true' + // Note: this uses an unsigned certificate which on first access + // will present a certificate warning in the browser. + // https: true, + server: 'dist', + port: dist_port + }); +}); + gulp.task('serve', ['styles', 'fonts'], function () { browserSync({ notify: false, diff --git a/package.json b/package.json index 9aa6cae..df1f3fd 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,8 @@ { "private": true, + "name": "yummy", + "version": "0.1.0", + "description": "", "engines": { "node": ">=0.10.0" }, @@ -15,6 +18,7 @@ "gulp-jshint": "^1.5.3", "gulp-load-plugins": "^0.8.0", "gulp-minify-html": "^0.1.6", + "gulp-mocha": "^2.0.1", "gulp-postcss": "^3.0.0", "gulp-size": "^1.1.0", "gulp-sourcemaps": "^1.3.0", @@ -23,6 +27,15 @@ "jshint-stylish": "^1.0.0", "main-bower-files": "^2.5.0", "opn": "^1.0.0", + "pre-commit": "^1.0.7", "wiredep": "^2.0.0" - } + }, + "scripts": { + "test": "gulp && git status | grep 'working directory clean' >/dev/null || (echo 'Please commit all changes generated by building'; exit 1)", + "start": "gulp serve:dist", + "lint": "gulp jshint" + }, + "pre-commit": [ + "lint" + ] }