Modifying Context Menu to Run Mocha

Hello, I'm looking for help or an explanation on how to add a context menu item that satisfies the following problem:

1.) We are using Node.js, and specifically we are using the webpack build system to convert ES6 code to ES5 code using the babel loader, etc.

2.) I have already configured the webpack builds so that they generate files that can be run with mocha through the command line, and even the JetBrains test runner when I set up the configuration manually. I have a tests folder that I build into a tests-build folder on a one-to-one map. The rationale for this is that I want to be able to build and run individual test files, because running all of the tests will eventually get tedious when I'm building just one.

3.) Setting up the configuration manually is somewhat tedious, and I've have more positive experiences using the context menu to run test scripts. I want to make the items in the test-build folder to run using the mocha test runner.

I can't seem to get this to work properly, I'm confused on how the context menu editor works in general, and how it knows when to display certain context menu items, and when not to. An explanation would be appreciated.

Thanks, Jim

1 comment
Comment actions Permalink

what is wrong with context menus? I can easily create and run Mocha run configurations from spec file right-click menu. This can also be done from individual tests menus in editor:

 

0

Please sign in to leave a comment.