node-vim-debugger icon indicating copy to clipboard operation
node-vim-debugger copied to clipboard

Integration with mocha

Open sidorares opened this issue 11 years ago • 8 comments

I often use cli debugger with mocha via mocha debug test/foo/bar. It would be great to have mocha vimdebug test/foo/bar (if possible without modification to mocha, via mocha.opts + --require )

sidorares avatar Sep 01 '14 05:09 sidorares

Just a reminder that mocha isn't the only test runner out there...

faridnsh avatar Sep 01 '14 16:09 faridnsh

Of course, feel free to submit PR for yours :) ( and I'm not aware of others that can spawn test + debugger )

sidorares avatar Sep 01 '14 23:09 sidorares

@sidorares have you gotten this to work with vanilla mocha? that's what i'm looking at now

AndrewRayCode avatar Jan 16 '15 20:01 AndrewRayCode

@DelvarWorld no, I haven't looked at this yet

sidorares avatar Jan 16 '15 21:01 sidorares

@DelvarWorld afaik you can start mocha tests with --debug-brk, that way workflow should be identical as documented in the readme

sidorares avatar Nov 27 '15 05:11 sidorares

You can also debug the mocha unit tests by running by debugging node_modules/mocha/bin/_mocha from your root project folder. This assumes you have mocha installed as a (dev-)dependency in your project (as it should be).

Seikho avatar Dec 18 '15 01:12 Seikho

yes, I'm just thinking about best way on how to integrate this for mocha users which would require wery little configuration ( line in mocha.opts or something similar )

sidorares avatar Dec 18 '15 01:12 sidorares

Instructions in the readme should be sufficient, in my opinion. Create a debug.js in the root project require that contains the code:

require('node_modules/mocha/bin_mocha')

Then use node-vim-inspector debug.js to get started.

Seikho avatar Dec 18 '15 01:12 Seikho