0

WebStorm Run-'Edit Configuration' is set up to run Mocha test.

The Mocha Javascript test code accepts nconf command line arguments for e.g. --user='production'

How can 'Edit Configuration' for Mocha test be set up to accept the nconf command line argument?

SUM
  • 1,651
  • 4
  • 33
  • 57

1 Answers1

1

You can use Extra Mocha Options field for this:

enter image description here

Works fine for me when using the following code:

var nconf = require('nconf');
nconf.argv();

describe("Numbers", function () {
        var foo, json;

        beforeEach(function(){
            foo = nconf.get('foo');
             ...
lena
  • 90,154
  • 11
  • 145
  • 150