mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Add virtualConsole option
This commit is contained in:
parent
ba3fd95f14
commit
f3719add05
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user