mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
30 lines
721 B
TypeScript
30 lines
721 B
TypeScript
/* eslint-env jest */
|
|
import path from 'path'
|
|
import { nextTestSetup, FileRef } from 'e2e-utils'
|
|
|
|
describe('app dir - proxy without pages dir', () => {
|
|
const { next } = nextTestSetup({
|
|
files: {
|
|
app: new FileRef(path.join(__dirname, 'app')),
|
|
'next.config.js': new FileRef(path.join(__dirname, 'next.config.js')),
|
|
'proxy.js': `
|
|
import { NextResponse } from 'next/server'
|
|
|
|
export async function proxy(request) {
|
|
return new NextResponse('redirected')
|
|
}
|
|
|
|
export const config = {
|
|
matcher: '/headers'
|
|
}
|
|
`,
|
|
},
|
|
})
|
|
|
|
it('Updates headers', async () => {
|
|
const html = await next.render('/headers')
|
|
|
|
expect(html).toContain('redirected')
|
|
})
|
|
})
|