--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
42
node_modules/gulp-print/test/gulp-print.spec.coffee
generated
vendored
Normal file
42
node_modules/gulp-print/test/gulp-print.spec.coffee
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
require 'coffee-errors'
|
||||
|
||||
path = require 'path'
|
||||
chai = require 'chai'
|
||||
sinon = require 'sinon'
|
||||
gutil = require 'gulp-util'
|
||||
# using compiled JavaScript file here to be sure module works
|
||||
print = require '../lib/gulp-print.js'
|
||||
|
||||
expect = chai.expect
|
||||
chai.use require 'sinon-chai'
|
||||
|
||||
describe 'gulp-print', ->
|
||||
beforeEach ->
|
||||
sinon.stub print, 'log'
|
||||
|
||||
afterEach ->
|
||||
print.log.restore()
|
||||
|
||||
describe 'passing formatting function', ->
|
||||
it 'logs file path using default formatter', (done) ->
|
||||
stream = print()
|
||||
filepath = path.join process.cwd(), 'foo/bar.js'
|
||||
|
||||
stream.on 'end', ->
|
||||
expect(print.log).to.have.been.calledWith gutil.colors.magenta path.relative process.cwd(), filepath
|
||||
done()
|
||||
|
||||
stream.write new gutil.File path: filepath
|
||||
stream.end()
|
||||
|
||||
it 'logs file paths using custom formatter', (done) ->
|
||||
stream = print (filepath) -> "Hello #{filepath}"
|
||||
filepath = path.join process.cwd(), 'foo/bar.js'
|
||||
|
||||
stream.on 'end', ->
|
||||
expect(print.log).to.have.been.calledWith "Hello #{gutil.colors.magenta path.relative process.cwd(), filepath}"
|
||||
done()
|
||||
|
||||
stream.write new gutil.File path: filepath
|
||||
stream.end()
|
||||
|
||||
5
node_modules/gulp-print/test/mocha.opts
generated
vendored
Normal file
5
node_modules/gulp-print/test/mocha.opts
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
--compilers coffee:coffee-script/register
|
||||
--recursive
|
||||
--reporter spec
|
||||
--ui bdd
|
||||
--timeout 1000
|
||||
Loading…
Reference in a new issue