UNPKG

606 Btext/coffeescriptView Raw
1path = require 'path'
2q = require 'q'
3_ = require 'lodash'
4TWO_MINUTES = 120000
5
6gt.module 'output with newlines format',
7 setup: ->
8 process.chdir path.join(__dirname, 'test-next-updater')
9 teardown: ->
10 process.chdir __dirname
11
12nextUpdate = require '..'
13
14gt.async 'error reporting', ->
15 opts =
16 module: 'check-types'
17 latest: true
18 promise = nextUpdate(opts)
19 gt.ok q.isPromise(promise), 'next update returns a promise'
20 promise.then -> console.log 'everything is ok'
21 promise.catch -> gt.ok false, 'promise failed'
22 promise.finally -> gt.start()
23, TWO_MINUTES