未验证 提交 2d1f64d2 编写于 作者: F Fabian Mastenbroek 提交者: GitHub

Support distDir with trailing slash for static files (#10592)

上级 ed66d14d
module.exports = {
distDir: '.next/',
}
export default () => 'hello from index'
/* eslint-env jest */
/* global jasmine */
import { join } from 'path'
import { killApp, findPort, launchApp, fetchViaHTTP } from 'next-test-utils'
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
const appDir = join(__dirname, '../')
let appPort
let app
const runTest = (mode = 'server') => {
it('supports trailing slash', async () => {
const res = await fetchViaHTTP(
appPort,
'/_next/static/development/pages/index.js'
)
expect(res.status).toBe(200)
})
}
describe('Trailing slash in distDir', () => {
describe('dev mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
})
afterAll(() => killApp(app))
runTest('dev')
})
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册