RubyMine 6.3.0 Web Help

On this page:

Prerequisites
  1. Download and install Node.js. The framework is required for two reasons:
    • The transpiledLanguage toolType is started through Node.js.
    • NPM, which is a part of the framework, is also the easiest way to download the transpiledLanguage toolType.

    For details on using Node.js in RubyMine, see the section Node.js

    Tip

    Alternatively, you can define Node.js as an external tool, as described in the section Configuring third-party tools. This approach is helpful, when you need facilities that are missing in the plugin, for example, the possibility to pass certain parameters as wildcards.

  2. If you are going to use the command line mode, make sure the following paths are added to the PATH variable:
    1. The path to the parent folder of the Node.js executable file.
    2. The path to the npm folder.

    This enables you to launch the transpiledLanguage toolType and npm from any folder.

  3. Make sure the Mocha test framework is installed as described in Preparing to Use Mocha Test Framework.
  4. Install and enable the NodeJS repository plugin.

    The plugin is not bundled with RubyMine, but it is available from the RubyMine plugin repository. Once enabled, the plugin is available at the IDE level, that is, you can use it in all your RubyMine projects.

  5. Install and enable the Mocha repository plugin.

    The plugin is not bundled with RubyMine, but it is available from the RubyMine plugin repository. Once enabled, the plugin is available at the IDE level, that is, you can use it in all your RubyMine projects.

Creating a Mocha run configuration
  1. Open the Run/Debug Configuration dialog box by doing one of the following:
    • On the main menu, choose Run | Edit Configurations.
    • Press RunConfigurationRunConfigurationRunConfigurationRunConfigurationRunConfigurationRunConfigurationRunConfigurationRunConfigurationRunConfigurationRunConfigurationRunConfigurationRunConfigurationControl Alt F7 and choose Edit Configuration on the context menu.
    • Open the test file in the editor, and then choose Create <file name> on the context menu.
    • Select the test file in the Project tool window, and then choose Create <file name> on the context menu of the selection.
  2. Click the Add button add on the toolbar and select the Mocha configuration type.
  3. In the dialog box that opens, specify the location of the Node.js and Node package, the working directory and the test directory, and choose the interface used in the test to run.
  4. Apply the changes and close the dialog box.