Unverified Commit d158c0c5 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Make dev watch ignore more specific (#39504)

This fixes the case where we were incorrectly ignoring the next-auth API endpoint since it matched the `.next` watch ignore and also adds a test case to ensure we match this route correctly. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: https://github.com/vercel/next.js/issues/39495
parent f863ba71
...@@ -266,7 +266,7 @@ export default class DevServer extends Server { ...@@ -266,7 +266,7 @@ export default class DevServer extends Server {
}) })
const wp = (this.webpackWatcher = new Watchpack({ const wp = (this.webpackWatcher = new Watchpack({
ignored: /(node_modules|\.next)/, ignored: /([/\\]node_modules[/\\]|[/\\]\.next[/\\]|[/\\]\.git[/\\])/,
})) }))
const pages = [this.pagesDir] const pages = [this.pagesDir]
const app = this.appDir ? [this.appDir] : [] const app = this.appDir ? [this.appDir] : []
......
export default function handler(req, res) {
res.json({ from: 'auth' })
}
...@@ -26,6 +26,14 @@ let mode ...@@ -26,6 +26,14 @@ let mode
let app let app
function runTests(dev = false) { function runTests(dev = false) {
it('should respond from /api/auth/[...nextauth] correctly', async () => {
const res = await fetchViaHTTP(appPort, '/api/auth/signin', undefined, {
redirect: 'manual',
})
expect(res.status).toBe(200)
expect(await res.json()).toEqual({ from: 'auth' })
})
it('should handle 204 status correctly', async () => { it('should handle 204 status correctly', async () => {
const res = await fetchViaHTTP(appPort, '/api/status-204', undefined, { const res = await fetchViaHTTP(appPort, '/api/status-204', undefined, {
redirect: 'manual', redirect: 'manual',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment