MongoDB-Memory-Server makes jest test debug get stuck on WSL

Viewed 572

I'm using TypeScript with Nodejs, and I'm testing my MongoDB database with Jest and mongo-memory-server.

I have been using it for some time now (on Arch Linux) and it worked just fine.

Recently I tried WSL (Ubuntu 20.04), and weirdly, when I'm trying to debug any test with mongo-memory-server, it gets stuck immediately, like it's computing something. When I pause, it's on emitHookFactory in async_hooks.js.

Also, mongo_killer.js seems to be running on the call stack.

When I try this on Linux it works just fine again.

What can I do?

EDIT: All the tests pass and the program runs fine, this occurs only when debugging.

EDIT 2: I've noticed something really weird: if I press "Step Over" as quickly as it shows up, the debugger doesn't get stuck, and works fine. I'm using the VSCode debugger by the way.

1 Answers

It turns out that using the "Step Over" button in the "Call Stack" menu in the sidebar works.

Related