Files
next.js/test/development/app-dir/logging-incoming-request/logging-incoming-request-false.test.ts
Jiachi LiuandGitHub 7c3705ded1 fix: incoming requests should use plural (#75582)
### What

Fixes the mismatch between docs and the feature code, aligning with docs
and other properties in logging option.
2025-02-03 18:31:41 +01:00

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')
})
})