Skip to content

Commit

Permalink
Improve cli test
Browse files Browse the repository at this point in the history
  • Loading branch information
macor161 committed Sep 5, 2019
1 parent cd2bcb1 commit 8001694
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -48,4 +48,4 @@ process.on('uncaughtException', e => {
debug('Uncaught Error: %o', e.stack)
})

main()
module.exports = main()
11 changes: 2 additions & 9 deletions test/cli.spec.js
Expand Up @@ -16,16 +16,9 @@ describe('CLI', () => {
error: jest.fn(),
}

require('../src/index')
await require('../src/index')

await wait(30000)

expect(console.log).toHaveBeenCalledWith(green.bold('Build successful'))
expect(console.log).toHaveBeenCalled()
expect(console.error).not.toHaveBeenCalled()
}, 60000)
})


function wait(ms) {
return new Promise(res => setTimeout(res, ms))
}

0 comments on commit 8001694

Please sign in to comment.