From ada5ffb84eeefed0d3318948aef493e749da9d70 Mon Sep 17 00:00:00 2001 From: pimlie Date: Sun, 17 Dec 2017 22:14:05 +0100 Subject: [PATCH] Fix stdout/stderr interceptors --- test/basic.dev.test.js | 2 +- test/helpers/console.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/basic.dev.test.js b/test/basic.dev.test.js index efdf90e3f4..8bd9e552a5 100644 --- a/test/basic.dev.test.js +++ b/test/basic.dev.test.js @@ -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')) diff --git a/test/helpers/console.js b/test/helpers/console.js index 036883e8b1..6a89271b90 100644 --- a/test/helpers/console.js +++ b/test/helpers/console.js @@ -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) {