mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Set virtualConsole to true by default
This commit is contained in:
parent
f33afa521f
commit
8d17d20dba
@ -109,9 +109,9 @@ export function renderAndGetWindow (url, opts = {}) {
|
|||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let virtualConsole
|
let virtualConsole = jsdom.createVirtualConsole().sendTo(console)
|
||||||
if (opts.virtualConsole === true) {
|
if (opts.virtualConsole === false) {
|
||||||
virtualConsole = jsdom.createVirtualConsole().sendTo(console)
|
virtualConsole = undefined
|
||||||
}
|
}
|
||||||
url = url || 'http://localhost:3000'
|
url = url || 'http://localhost:3000'
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
@ -43,7 +43,7 @@ test('/stateful', async t => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('/head', 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 html = window.document.body.innerHTML
|
||||||
const metas = window.document.getElementsByTagName('meta')
|
const metas = window.document.getElementsByTagName('meta')
|
||||||
t.is(window.document.title, 'My title')
|
t.is(window.document.title, 'My title')
|
||||||
|
Loading…
Reference in New Issue
Block a user