hbenl / vscode-mocha-test-adapter

Mocha Test Adapter for the VS Code Test Explorer
MIT License
91 stars 31 forks source link

Discussion: how to simplify local custom launcher #135

Open jedwards1211 opened 3 years ago

jedwards1211 commented 3 years ago

I'd like to use this, but I need to run different commands for unit testing, selenium testing, db testing, etc in my project. Aside from just passing in different mocha options, some of these commands also ensure that docker containers are running before spawning mocha. But mocha itself just needs to run locally.

I guess this isn't a common case and most people are able to rely on global mocha options for all tests in a project?

Theoretically I could make a launcherScript that launches mocha locally, not remotely, and decides which actual command to use based upon the directory the test(s) are located in. But I see in the examples at least that they're just forwarding along a raw JS script that should be executed on the remote node, meaning there's no way I can customize the mocha options in my launcher script at all, as far as I can tell. (Not to mention that's scary from a security standpoint). It does really feel like Mocha needs to standardize a way of emitting events over a TCP socket or IPC, so that we wouldn't need to inject any hooks for that.