mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Fix stdout/stderr interceptors
This commit is contained in:
parent
fffe741986
commit
ada5ffb84e
@ -38,7 +38,7 @@ test.serial('Init Nuxt.js', async t => {
|
||||
})
|
||||
|
||||
test.serial('remove mixins in live reloading', async t => {
|
||||
const spies = await intercept()
|
||||
const spies = await intercept({ log: true, error: true, stderr: true })
|
||||
await nuxt.renderRoute(url('/'))
|
||||
t.true(spies.log.calledWith('I am mixin'))
|
||||
|
||||
|
@ -80,8 +80,8 @@ export async function intercept(levels, msg, cb) {
|
||||
}
|
||||
|
||||
if (levels && levels.stderr) {
|
||||
context.stdout = process.stderr.write
|
||||
spies.stdout = process.stderr.write = sinon.spy()
|
||||
context.stderr = process.stderr.write
|
||||
spies.stderr = process.stderr.write = sinon.spy()
|
||||
}
|
||||
|
||||
if (cb) {
|
||||
@ -126,8 +126,8 @@ export async function interceptError(msg, cb) {
|
||||
}
|
||||
|
||||
export async function interceptStdout(msg, cb) {
|
||||
const { stderr } = await intercept({ stdout: true }, msg, cb)
|
||||
return stderr
|
||||
const { stdout } = await intercept({ stdout: true }, msg, cb)
|
||||
return stdout
|
||||
}
|
||||
|
||||
export async function interceptStderr(msg, cb) {
|
||||
|
Loading…
Reference in New Issue
Block a user