Skip to content

"server is not enabled" error #289

@HussainAlMeshaima

Description

@HussainAlMeshaima

I'm trying to test the provided example in documentation.

that is:

import { get, setupTest } from '@nuxt/test-utils'

describe('ssr', () => {
  setupTest({ server: true })

  it('renders the index page', async () => {
    const { body } = await get('/')

    expect(body).toContain('<a>A Link</a>')
  })
})

the test fails, with an error of server is not enabled.

server is not enabled

   5 |
   6 |     it('renders the index page', async () => {
>  7 |         const thePage = url('/page')
     |                         ^
   8 |         // is something like 'http://localhost:6840/page'
   9 |         expect(sum(1, 2)).toBe(3);
  10 |     })

i have used the defeat configuration mentioned in the installation.

what I'm I doing wrong exactly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions