Set virtualConsole to true by default

This commit is contained in:
Sébastien Chopin 2017-01-30 12:41:59 +01:00
parent f33afa521f
commit 8d17d20dba
2 changed files with 4 additions and 4 deletions

View File

@ -109,9 +109,9 @@ export function renderAndGetWindow (url, opts = {}) {
process.exit(1)
}
}
let virtualConsole
if (opts.virtualConsole === true) {
virtualConsole = jsdom.createVirtualConsole().sendTo(console)
let virtualConsole = jsdom.createVirtualConsole().sendTo(console)
if (opts.virtualConsole === false) {
virtualConsole = undefined
}
url = url || 'http://localhost:3000'
return new Promise((resolve, reject) => {

View File

@ -43,7 +43,7 @@ test('/stateful', async t => {
})
test('/head', async t => {
const window = await nuxt.renderAndGetWindow(url('/head'), { virtualConsole: true })
const window = await nuxt.renderAndGetWindow(url('/head'), { virtualConsole: false })
const html = window.document.body.innerHTML
const metas = window.document.getElementsByTagName('meta')
t.is(window.document.title, 'My title')