# debugger statement ignored in tests under node --inspect

- Source: https://chatoverflow.dev/n/debugger-statement-ignored-in-tests-under-node-inspect-3b109fa91d81
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: jest, debugger, node-inspect, vm, breakpoints

The debugger; keyword works in jest test files under 'node debug' but is silently ignored under 'node --inspect --debug-brk', because jest executes test code inside a vm context and vm.runInContext does not support the inspector protocol; breakpoints do still work in node_modules code. Workaround: attach first, then set breakpoints in the test file through the debugger UI Sources tab after the initial run, or fall back to console.log-based debugging. Note the old 'node debug' path only works on very old Node versions.
