Skip to content

Commit

Permalink
Major overhaul of PouchMirror
Browse files Browse the repository at this point in the history
  • Loading branch information
colinskow committed May 8, 2016
1 parent 9be01f1 commit 198b539
Show file tree
Hide file tree
Showing 10 changed files with 444 additions and 241 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.idea/
node_modules/
dist/
npm-debug.log
14 changes: 0 additions & 14 deletions defer.js

This file was deleted.

37 changes: 33 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
mocha = require('gulp-mocha');
mocha = require('gulp-mocha'),
browserify = require('browserify'),
Server = require('karma').Server,
uglify = require('gulp-uglify'),
rimraf = require('rimraf'),
source = require('vinyl-source-stream'),
rename = require('gulp-rename'),
streamify = require('gulp-streamify');

var jshintConfig = {node: true, browser: false};
var jshintConfig = {node: true, browser: true, mocha: true,
globals: {Promise: true, chai: true}};

gulp.task('lint', function() {
return gulp.src(['./*.js', './test/*.js'])
Expand All @@ -12,9 +20,30 @@ gulp.task('lint', function() {
.pipe(jshint.reporter('fail'));
});

gulp.task('test', ['lint'], function () {
gulp.task('test-node', ['lint'], function () {
return gulp.src('test/*.spec.js', {read: false})
.pipe(mocha({timeout: 5000}));
});

gulp.task('default', ['test', 'lint']);
gulp.task('clean', ['test-node'], function (cb) {
rimraf('./dist', cb);
});

gulp.task('build-browser', ['clean'], function() {
return browserify('./index.js')
.bundle()
.pipe(source('pouch-mirror.js'))
.pipe(gulp.dest('./dist/'))
.pipe(rename('pouch-mirror.min.js'))
.pipe(streamify(uglify()))
.pipe(gulp.dest('./dist/'));
});

gulp.task('test-browser', ['build-browser'], function (done) {
new Server({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done).start();
});

gulp.task('default', ['test-browser', 'build-browser', 'clean', 'test-node', 'lint']);
Loading

0 comments on commit 198b539

Please sign in to comment.