'use strict';
var gulp = require('gulp'),
    jasmine = require('gulp-jasmine'),
    babel = require('gulp-babel'),
    concat = require('gulp-concat');

gulp.task('build', () => {
  return gulp.src('src/**.js')
    .pipe(babel({
      presets: ['es2015'],
      plugins: ['transform-es2015-modules-umd']
    }))
    .pipe(concat('index.js'))
    .pipe(gulp.dest('./'));
});

gulp.task('test', () => {
  return gulp.src('spec/**.js')
    .pipe(jasmine({
      config: {
        "spec_dir": "spec",
        "spec_files": [
          "**/*[sS]pec.js"
        ],
        "helpers": [
          "helpers/**/*.js"
          ],
        "stopSpecOnExpectationFailure": false,
        "random": false
      }
    }));

});

gulp.task('watch', () => {
  gulp.watch('src/*.js', ['build', 'test']);
  gulp.watch(['spec/**/*.js', 'spec/*.js', 'spec/**/*.tale'], ['test']);
});

gulp.task('devel', ['default', 'watch']);
gulp.task('default',['build', 'test']);

'use strict';
var gulp = require('gulp'),
    jasmine = require('gulp-jasmine'),
    babel = require('gulp-babel'),
    concat = require('gulp-concat');

gulp.task('build', () => {
  return gulp.src('src/**.js')
    .pipe(babel({
      presets: ['es2015'],
      plugins: ['transform-es2015-modules-umd']
    }))
    .pipe(concat('index.js'))
    .pipe(gulp.dest('./'));
});

gulp.task('test', () => {
  return gulp.src('spec/**.js')
    .pipe(jasmine({
      config: {
        "spec_dir": "spec",
        "spec_files": [
          "**/*[sS]pec.js"
        ],
        "helpers": [
          "helpers/**/*.js"
          ],
        "stopSpecOnExpectationFailure": false,
        "random": false
      }
    }));

});

gulp.task('watch', () => {
  gulp.watch('src/*.js', ['build']);
  gulp.watch(['spec/**/*.js', 'spec/*.js', 'spec/**/*.tale', 'index.js'], ['test']);
});

gulp.task('devel', ['default', 'watch']);
gulp.task('default',['build', 'watch']);

Fix the way to build and test
Fix the way to build and test
