Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Debug just failed tests #612

Closed
colin-jack opened this Issue Oct 14, 2012 · 7 comments

Comments

Projects
None yet
5 participants

I was wondering if there could be an additional option for vows that would allow debugging but only of failed tests.

This would allow me to have mocha running in one window spitting out all the results but another terminal window(/pane) could be responsible for letting me debug against the failed tests.

This would allow a workflow:

  • Modify the code or tests
  • Mocha is watching and triggers the tests
  • The new step is triggered for any failed tests
  • Debug the first failed test and hopefully then fix the code/tests which triggers a run of all tests.
Contributor

tj commented Oct 15, 2012

we could separate stdout and stderr (not sure why we are not ATM actually...) in which case you can just display stderr, or optionally use --bail which exits on the first error

Sounds good thanks.

Bail is useful for sure, one of the many useful features in mocha. However when I do bail I sometimes end up wanting to debug the failed test (or the tests in that file). I know I can debug the entire test suite easily but it adds more friction especially when I've got breakpoints.

Anyhow as long as the input going to stderr had the name of the file containing the failing test I should be able to do what I want.

Contributor

tj commented Oct 19, 2012

you can do it.only('name to only execute that one test, or describe.only( for that suite

Yeah that is a good feature, maybe I under-use it because I find if I'm using the watch feature and use describe.only then it does indeed just run the one test, but if I remove the only again it keeps just running the one test...but I'm thinking that's probably a bug and I'll log it separately.

Contributor

tj commented Oct 22, 2012

hmm yeah maybe, i dont use watch so i miss that stuff

Contributor

tj commented Oct 22, 2012

we must not be resetting the Mocha state related things like .grep()

I really like the workflow @colin-jack describes. Any tips on how I'd go about implementing this, having never looked at the mocha codebase before?

@boneskull boneskull added wontfix and removed help-wanted labels Oct 17, 2017

@boneskull boneskull closed this Oct 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment