Nuxt/test/utils/setup.js

27 lines
566 B
JavaScript
Raw Normal View History

2018-11-08 09:15:56 +00:00
import consola from 'consola'
import chalk from 'chalk'
import env from 'std-env'
import exit from 'exit'
2018-11-08 09:15:56 +00:00
2019-01-29 11:29:55 +00:00
const isWin = env.windows
describe.win = isWin ? describe : describe.skip
test.win = isWin ? test : test.skip
describe.posix = !isWin ? describe : describe.skip
test.posix = !isWin ? test : test.skip
chalk.level = 0
2018-11-08 09:15:56 +00:00
2018-08-16 15:46:42 +00:00
jest.setTimeout(60000)
2018-11-08 09:15:56 +00:00
consola.mockTypes(() => jest.fn())
function errorTrap (error) {
process.stderr.write('\n' + error.stack + '\n')
exit(1)
}
process.on('unhandledRejection', errorTrap)
process.on('uncaughtException', errorTrap)