Default configuration for Mocha not saved

Hi all

I'm using webstorm to develop a JS/TS project, and mocha for running tests. It requires a global configuration file passed as a parameter with `--require test/setup.js`.

If I create my own test profile, then no problem, but if I run the single tests with the corresponding icons in the .spec.js files, it throws an error, which means that the required file wasn't loaded.

I then edit the default configuration for Mocha, add the line, and they now run fine.

The problem is that the preference doesn't persist. I might add that I use multiple computers with the same project, both updated. The default configuration doesn't seem to be added to the workspace.xml file.

Is this a bug? Expected behaviour? Keep in mind that my settings are synced with a git repo.

Thanks

1

Sure it's not the expected behavior. Can you recreate it with your other projects/new project?

Also, please reproduce the issue and provide your idea.log (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files)

Don't paste it here, upload it on some file server and provide a link

0
Avatar
Permanently deleted user

It doesn't happen with a new angular cli project, but it systematically happens with my project when I close and reopen it.

Didn't find anything relevant in the logs.

I see that the following lines are created on the good one but is missing on mine:

<component name="RunManager">
<configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
<node-interpreter>project</node-interpreter>
<node-options />
<working-directory />
<pass-parent-env>true</pass-parent-env>
<ui />
<extra-mocha-options>--require test/setup.js</extra-mocha-options>
<test-kind>DIRECTORY</test-kind>
<test-directory />
<recursive>false</recursive>
</configuration>
</component>

0
Avatar
Permanently deleted user

Manually editing the workspace.xml file solved temporarily the issue. I may advise to re-check the code that serialises the workspace state.

0

>Didn't find anything relevant in the logs.

 

please provide them anyway

0

well.. nothing in the log indeed... the recorded activities mostly refer to working with a new (untitled) project you don't have issues with

0
Avatar
Permanently deleted user

I just logged in to say I have the same issue and Mc128k is not the only one who have it, I had to manually edit workspace.xml to save my default settings.

1
Avatar
Permanently deleted user

Having this same issue with jest configurations I would like to have --env=jsdom set as default however it never sticks after I shut down intellij.  I've fixed by editing the workspace.xml as well.

0
Avatar
Permanently deleted user

This issue is happening for me, and I am on version 2018.2.2

1

please reproduce the issue and provide your idea.log (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files)

Don't paste it here, upload it on some file server and provide a link

0
Avatar
Permanently deleted user

Can no longer reproduce.  If it happens again, I will grab the logs.  

1

请先登录再写评论。