How to use Relative Paths in Run/Debug Configurations?

Is it possible to use Relative Paths in Run/Debug configurations? For example, Mocha test configurations seem to require Absolute paths which means if you move or copy the project all the test configurations break. I'd like to:

1) Define the location of the Mocha tool relative to the working directory. This is important when using different mocha versions and --compilers on the project level. Otherwise, for ES2015 you have to create long options paths to Babel, etc.

2) Define the location of the test file itself relative to the working directory

I've tried various formats:

./foo/bar_test
/foo/bar_test
foo/bar_test

What is the proper way to specify tool location and test file location relative to the current project's working directory?

Thanks for any help with this.

1 comment

No, you can't enter relative paths there.

In .xml file that stores Mocha run configuration, path to tests dir, etc. is stored relative to project root, using $PROJECT_DIR$ macro:

<working-directory>$PROJECT_DIR$</working-directory>

<test-kind>DIRECTORY</test-kind>
<test-directory>$PROJECT_DIR$/specs</test-directory>

so the tests path doesn't change when you move/copy your project to different location


Path to mocha  package is unfortunately saved as an absolute path, but WebStorm detects Mocha package in project dir, if any, and offers it in paths dropdown in 'Mocha package' field

1

Please sign in to leave a comment.