Skip to content

[Bug]: Code execution does not break in debugging tool when watch mode is set #14336

@cdoublev

Description

@cdoublev

Version

29.6.1

Steps to reproduce

  1. Clone my repo at https://github.com/cdoublev/jest-issue
  2. node --inspect-brk=0.0.0.0:9222 ./node_modules/.bin/jest --watchAll (npm test)
  3. Open chrome://inspect/ in Chrome
  4. Click inspect in the target list

Expected behavior

I expect the code to break at the debugger line in ./add.js.

Actual behavior

The code did not break.

Additional context

I run the above steps in a virtual machine. I connect to the VM from my terminal with a SSH tunnel localhost:9222 -> 0.0.0.0:9222.

I have not checked if the problem occurs without the SSH tunnel because I am using a virtual machine so I do not have to install NodeJS on my machine's OS.

But I guess this problem is specific to this context, and is related to this change in version 29.6.0:

[jest-core] Always use workers in watch mode to avoid crashes (#14059)

Indeed, the code breaks when removing --watchAll from the command line arguments.

Environment

System:
  OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
  CPU: (1) x64 Intel(R) Core(TM) i7-3612QM CPU @ 2.10GHz
Binaries:
  Node: 20.3.0 - /usr/bin/node
  npm: 9.6.7 - /usr/bin/npm
npmPackages:
  jest: ^29.6.1 => 29.6.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions