Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

added webstorm mocha runner documentation #1208

Merged
merged 3 commits into from
Nov 23, 2018
Merged

Conversation

epikhighs
Copy link
Contributor

Hi everyone,

This is my first time contributing. I was checking out neutrino and noticed there was no docs on how to get Webstorm's Mocha Runner working with neutrino. If this should be located elsewhere then lmk. Hope this helps someone 😄

## Webstorm Mocha Runner
Webstorm has a mocha runner that enables running mocha tests within the IDE. The mocha runner also allows for debugging of mocha tests in Webstorm. Basic setup can be found at [Webstorm's Mocha Run/Debug documentation](https://www.jetbrains.com/help/webstorm/run-debug-configuration-mocha.html). _Note: since neutrino takes care of installing mocha, you do not need to install mocha separately._ Once you are familiar with the basics, the following steps will allow you to use Webstorm's mocha runner with neutrino.

- create a `.babelrc` in project root. _As of `neutrino 8.x`, the config provided assumes neutrino is still relying on `babel 6.x`. If neutrino updates to use `babel 7.x`, then the plugin names below will likely need to be updated to reflect the updated `babel 7.x` version._
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to use 1. for numbered list, but I couldn't get markdown to continue the numbered list with the code snippet for .babelrc. So I just resorted to using bullets instead, which is fine for me as well.

@edmorley edmorley added the docs label Nov 14, 2018
Copy link
Member

@edmorley edmorley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thank you for the PR.

The master branch is currently for Neutrino 9, whereas the wording of the steps added here suggest they are based on Neutrino 8 which uses quite a different approach for configuring webpack/mocha/...

Could you update it to be compatible with Neutrino 9? (see #1129 for how to try the beta)
I believe the best way to set up webstorm with Neutrino 9 might be to create the mocha.config.js file as suggested by the existing Neutrino Mocha preset docs, and then use the "Extra Mocha options" webstorm pref to pass the --require mocha.config.js to mocha.

Many thanks :-)

@edmorley
Copy link
Member

and then use the "Extra Mocha options" webstorm pref to pass the --require mocha.config.js to mocha.

The require flag could also be set via mocha.opts too.

@epikhighs
Copy link
Contributor Author

ok - should be good for 9.x and 8.x now. I just verified on a new project using npx @neutrinojs/create-project@next

@edmorley
Copy link
Member

Thank you for updating the PR. The docs are versioned with the code, so each branch's docs only cover that specific version - eg:
https://master.neutrinojs.org/ -> Neutrino 9 (since not yet released apart from the beta)
https://neutrinojs.org/ -> Neutrino 8
https://release-v7.neutrinojs.org/ -> Neutrino 7

Could you remove the Neutrino 8 part?

Copy link
Member

@edmorley edmorley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - many thanks! :-)

@edmorley edmorley merged commit 0488010 into neutrinojs:master Nov 23, 2018
@edmorley
Copy link
Member

Published at:
https://master.neutrinojs.org/packages/mocha/#webstorm-mocha-runner

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

2 participants