feat(server): allow passing loadingTimeout and other arguments to renderAndGetWindow() (#6178)

This commit is contained in:
yutanoma 2019-08-05 20:14:03 +09:00 committed by Pooya Parsa
parent b2def683ba
commit a87f5dde6a
2 changed files with 11 additions and 4 deletions

View File

@ -215,11 +215,17 @@ export default class Server {
return this.renderer.loadResources.apply(this.renderer, arguments)
}
renderAndGetWindow (url, opts = {}) {
renderAndGetWindow (url, opts = {}, {
loadingTimeout = 2000,
loadedCallback = this.globals.loadedCallback,
ssr = this.options.render.ssr,
globals = this.globals
} = {}) {
return renderAndGetWindow(url, opts, {
loadedCallback: this.globals.loadedCallback,
ssr: this.options.render.ssr,
globals: this.globals
loadingTimeout,
loadedCallback,
ssr,
globals
})
}

View File

@ -445,6 +445,7 @@ describe('server: server', () => {
expect(renderAndGetWindow).toBeCalledTimes(1)
expect(renderAndGetWindow).toBeCalledWith('/render/window', {}, {
loadingTimeout: 2000,
loadedCallback: globals.loadedCallback,
ssr: nuxt.options.render.ssr,
globals