import { resolve } from 'path' import { existsSync } from 'fs' import jsdom from 'jsdom' import Glob from 'glob' import pify from 'pify' import { getPort, loadFixture, Nuxt, rp } from '../utils' const glob = pify(Glob) let port const url = route => 'http://localhost:' + port + route let nuxt = null describe('with-config', () => { beforeAll(async () => { const config = await loadFixture('with-config') nuxt = new Nuxt(config) await nuxt.ready() port = await getPort() await nuxt.server.listen(port, 'localhost') }) test('client source map generated', async () => { const jsFiles = await glob(resolve(__dirname, '..', 'fixtures/with-config/.nuxt/dist/client/*.js')) for (const file of jsFiles) { expect(existsSync(`${file}.map`)).toBe(true) } }) test('/', async () => { const { html } = await nuxt.server.renderRoute('/') expect(html).toContain('
Made by Nuxt team
') }) test('/ (custom build.publicPath)', async () => { const { html } = await nuxt.server.renderRoute('/') expect(html).toContain('