mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
feat(server): allow passing loadingTimeout
and other arguments to renderAndGetWindow()
(#6178)
This commit is contained in:
parent
b2def683ba
commit
a87f5dde6a
@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user