Nuxt/test/dev/encoding.test.js
pooya parsa cc1f6d94b5
fix: handle route encoding (#8325)
Co-authored-by: farnabaz <farnabaz@users.noreply.github.com>
2020-11-30 23:10:02 +01:00

29 lines
668 B
JavaScript

import { getPort, loadFixture, Nuxt, rp } from '../utils'
let port
const url = route => 'http://localhost:' + port + encodeURI(route)
let nuxt = null
describe('encoding', () => {
beforeAll(async () => {
const config = await loadFixture('encoding')
nuxt = new Nuxt(config)
await nuxt.ready()
port = await getPort()
await nuxt.server.listen(port, 'localhost')
})
test('/ö/ (router base)', async () => {
const { body: response } = await rp(url('/ö/'))
expect(response).toContain('Unicode base works!')
})
// Close server and ask nuxt to stop listening to file changes
afterAll(async () => {
await nuxt.close()
})
})