Unverified Commit e1fe0c9a authored by Tomas Fagerbekk's avatar Tomas Fagerbekk Committed by GitHub

test: ability to use node debugger (#56277)

Fixes ability to run `NODE_OPTIONS='--inspect' next dev` as described in
[docs](https://nextjs.org/docs/pages/building-your-application/configuring/debugging),
by removing inspect option from NODE_OPTIONS arg passed to worker
process.

This bug seem to have been introduced in
7d93808c as a part of a some
refactoring. See how `getNodeOptionsWithoutInspect` is no longer used.

Fixes #55862

---------
Co-authored-by: 's avatarJiachi Liu <inbox@huozhi.im>
parent a578cc81
......@@ -530,6 +530,7 @@ describe('CLI Usage', () => {
test("NODE_OPTIONS='--inspect'", async () => {
const port = await findPort()
let output = ''
let errOutput = ''
const app = await runNextCommandDev(
[dirBasic, '--port', port],
undefined,
......@@ -537,11 +538,16 @@ describe('CLI Usage', () => {
onStdout(msg) {
output += stripAnsi(msg)
},
onStderr(msg) {
errOutput += stripAnsi(msg)
},
env: { NODE_OPTIONS: '--inspect' },
}
)
try {
await check(() => output, new RegExp(`http://localhost:${port}`))
await check(() => errOutput, /Debugger listening on/)
expect(errOutput).not.toContain('address already in use')
} finally {
await killApp(app)
}
......
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