9

I want to debug my test using Velocity and Mocha, using breakpoints and REPL instead of console.logs.

For debugging my app code I can start my Meteor app with the NODE_OPTIONS='--debug' flag, and then bind the debugger like node debug localhost:5858. This doesn't work for the mirror, although its log says debugger listening on port 5858 (both main app and mirror logs say that).

How can I debug it?

Tomas Romero
  • 8,418
  • 11
  • 50
  • 72
  • Hmm, I wonder if the main app's debugger is kicking in first and the second on the same port is not picking up. – Xolv.io Nov 22 '14 at 03:47
  • I tried running `NODE_OPTIONS='--debug' meteor run --test` expecting it to run the tests by only booting the mirror app, but its also starting the main app. I wonder if there's a reason for starting the main app when you only want to run tests. – Tomas Romero Nov 22 '14 at 18:43
  • 1
    See velocity [issue #235](https://github.com/meteor-velocity/velocity/issues/235) and [PR #298](https://github.com/meteor-velocity/velocity/pull/298). – Ryne Everett Apr 12 '15 at 18:38

1 Answers1

1

Use meteor debug instead of meteor run to start your meteor application. It will add the node inspector package to your running Meteor app so that you can debug it. Node inspector works by hooking into your running Meteor server

gatolgaj
  • 1,193
  • 7
  • 12