Stream Mocha progress to Atom ☕️ + ⚛️ = 🚀
This package allows Mocha to send its progress reports (which are normally shown on your Terminal window) to Atom and then do all kinds of interesting things with it, like
apm install ide-mocha
npm i --save-dev mocha-reporter-remote
Now you can use the custom reporter. The reporter needs to know where to send the progress data. The easiest way to see how to run Mocha is to execute
ide-mocha:show-help from the command pallete. 💪 Generally this looks like this:
# Using Unix socket connectionsnpx mocha --reporter mocha-reporter-remote --reporter-options address=/var/folders/np/yp1y_nk504b0k61prl2pk4b40000gn/T/mocha-reporter-remote.sock# Using TCP connectionsnpx mocha --reporter mocha-reporter-remote --reporter-options address=12345
Each project uses its own socket and port which remains stable even if you quit Atom, so it's safe to persist the socket/port info in your project config/environment variables or any other suitable place. If you don't have "any other suitable place" you can always use
ide-mocha:copy-receiver-address from the command pallete to get the socket path/port number for your current session, or
ide-mocha:copy-mocha-command to get the full command which you can just paste into a terminal. 💪
None 😇, but I suspect some will appear eventually, especially in these areas:
IPas the preferred interface type from the package settings - standard TCP networking should work just fine.
Because existing Mocha integrations for Atom kinda suck. They either do not work at all, implement custom UI elements which look weird and do not integrate well into Atom (or your current theme 🎨), or force you into giving up your test toolchain because they want to spawn Mocha for you in unexpected ways. This package has no such restrictions - all you need on your end is to install one dev dependency and pass two flags to Mocha to make the whole thing work. And the test suite could be started with a custom binary,
make, or heck, even from inside a Docker container (disclaimer: untested but should work in theory)! As long as Mocha can connect to the local socket or TCP port this is guaranteed to work. 💪
One picture is worth a thousand words, and a gif has many pictures... It's ugly, but it shows all the bits & pieces of this thing.
Please do! 🙏 If you have feedback, problems, or ideas, please open an issue and I'll do my best to help you out.
See the LICENSE file for information.
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.