Closed Spown closed 4 years ago
Add "mochaExplorer.monkeyPatch": false
to your settings, that should do exactly what you want.
The option was originally meant as a fallback if the location detection (which uses a monkey patch for Mocha - hence the option's name) creates problems for some reason. When the monkey patch is turned off, the adapter will look for the test's label in your source file instead and use that location if it finds one.
So I have this stupid ugly way of writing tests with an automation, where I have a registry of config, cleanup, prepare and tests directives and one iterator with a single
it()
in it, like so:And it does work swimmingly with Explorer UI:
However, when it comes to
Show source
function - it always jumps to where the only one "it" is. So since explorer/adapter clearly parses and reads the test titles regardless, maybe it could perform the jump to the title string declaration location, instead of where theit()
consumes it?Thank you.