/
gulp-es-next.spec.js
48 lines (37 loc) · 1.22 KB
/
gulp-es-next.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'use strict'
import {src, dest, task, watch, $, gulp} from 'gulp-es-next'
import expect from 'expect.js'
describe('gulp-es-next', () => {
it('should export gulp itself', () => {
expect(gulp).to.be.ok(require('gulp'))
expect(gulp).to.have.property('src')
expect(gulp).to.have.property('dest')
expect(gulp).to.have.property('task')
expect(gulp).to.have.property('watch')
})
it('should export gulp.src method', () => {
expect(src).to.be.ok(gulp.src)
})
it('should export gulp.dest method', () => {
expect(dest).to.be.ok(gulp.dest)
})
it('should export gulp.task method', () => {
expect(task).to.be.ok(gulp.task)
})
it('should export gulp.watch method', () => {
expect(watch).to.be.ok(gulp.watch)
})
it('should load gulp, its methods and plugins with require', () => {
let _ = require('gulp-es-next'),
gulp = require('gulp')
expect(_.gulp.src).to.be.ok(gulp.src)
expect(_.gulp.dest).to.be.ok(gulp.dest)
expect(_.gulp.task).to.be.ok(gulp.task)
expect(_.gulp.watch).to.be.ok(gulp.watch)
expect(_.$).to.eql(require('gulp-load-plugins')())
})
it('should export gulp.plugins defined in package.json in the $ object', () => {
expect($.uglify).to.be.a('function')
expect($.sourcemaps).to.be.ok()
})
})