1 | path = require 'path'
|
2 | q = require 'q'
|
3 | _ = require 'lodash'
|
4 | TWO_MINUTES = 120000
|
5 |
|
6 | gt.module 'output with newlines format',
|
7 | setup: ->
|
8 | process.chdir path.join(__dirname, 'test-next-updater')
|
9 | teardown: ->
|
10 | process.chdir __dirname
|
11 |
|
12 | nextUpdate = require '..'
|
13 |
|
14 | gt.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
|