From f3719add058d1fddec18fcecc593573b5db72d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Thu, 26 Jan 2017 15:21:02 +0100 Subject: [PATCH] Add virtualConsole option --- lib/render.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/render.js b/lib/render.js index 1b7c1f2dce..9f65a66e27 100644 --- a/lib/render.js +++ b/lib/render.js @@ -97,7 +97,7 @@ export function renderRoute (url, context = {}) { // Function used to do dom checking via jsdom let jsdom = null -export function renderAndGetWindow (url) { +export function renderAndGetWindow (url, opts = {}) { /* istanbul ignore if */ if (!jsdom) { try { @@ -109,7 +109,10 @@ export function renderAndGetWindow (url) { process.exit(1) } } - const virtualConsole = jsdom.createVirtualConsole().sendTo(console) + let virtualConsole + if (opts.virtualConsole === true) { + virtualConsole = jsdom.createVirtualConsole().sendTo(console) + } url = url || 'http://localhost:3000' return new Promise((resolve, reject) => { jsdom.env({