nuxt.renderAndGetWindow(url, options = {})

  • Type: Function
  • Argument: String
    1. String: url to render
    2. Optional, Object: options
      • virtualConsole: Boolean (default: true)
  • Returns: Promise
    • Returns: window

Get the window from a given url of a nuxt.js application.

This method is made for test purposes.

To use this function, you have to install jsdom:

npm install --save-dev jsdom


const { Nuxt, Builder } = require('nuxt')

const config = require('./nuxt.config.js') = false

const nuxt = new Nuxt(config)

.then((window) => {
  // Display the head <title>

Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!