fix(server): remove virtualConsole option when disabled (#8263)

This commit is contained in:
Perlover 2020-12-01 10:14:45 +01:00 committed by GitHub
parent 5b02f5b38c
commit 0bd21413cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,9 @@ export default async function renderAndGetWindow (
} }
// Throw error when window creation failed // Throw error when window creation failed
options.virtualConsole.on('jsdomError', jsdomErrHandler) options.virtualConsole.on('jsdomError', jsdomErrHandler)
} else {
// If we get the virtualConsole option as `false` we should delete for don't pass it to `jsdom.JSDOM.fromURL`
delete options.virtualConsole
} }
const { window } = await jsdom.JSDOM.fromURL(url, options) const { window } = await jsdom.JSDOM.fromURL(url, options)