mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What Fixes the mismatch between docs and the feature code, aligning with docs and other properties in logging option.
35 lines
861 B
TypeScript
35 lines
861 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { retry } from 'next-test-utils'
|
|
|
|
describe('logging-incoming-request', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
overrideFiles: {
|
|
'next.config.js': `
|
|
module.exports = {
|
|
logging: {
|
|
incomingRequests: false
|
|
}
|
|
}
|
|
`,
|
|
},
|
|
})
|
|
|
|
it('should handle disabled request logging', async () => {
|
|
let response = await next.fetch('/foo')
|
|
expect(response.status).toBe(200)
|
|
|
|
response = await next.fetch('/hello')
|
|
expect(response.status).toBe(200)
|
|
|
|
// Wait for GET /foo to be logged
|
|
await retry(() => {
|
|
expect(next.cliOutput).not.toContain('GET /foo')
|
|
})
|
|
|
|
// Verify no requests were logged
|
|
expect(next.cliOutput).not.toContain('GET /')
|
|
expect(next.cliOutput).not.toContain('GET /hello')
|
|
})
|
|
})
|