eirikb / AvaJavaScriptTestRunnerRunConfigurationGenerator

Generates a run configuration for AVA JavaScript test runner
3 stars 5 forks source link

Run configuration for IntelliJ IDEA disappears after IDE restart #98

Closed klindklind closed 1 year ago

klindklind commented 1 year ago

First of all - thanks for making this happen as there is no going back to Jest after I started to use AvaJS and I really don't want to switch IntelliJ IDEA🙏

Screenshot 2023-01-05 at 8 10 46

By default the Ava test runner points to node_modules/ava/cli.js which is not found from my npm project even though I've installed the avajs npm module successfully. The avajs executable is found from node_modules/.bin/ava which I've configured in my IDE to be able to run my tests.

However, every time I restart IntelliJ IDEA the default configuration is restore and avajs executable is again pointing to that missing executable node_modules/ava/cli.js. I remember this was working in the past and I didn't have to re-configure after IDE restart.

eirikb commented 1 year ago

Hi there. Did a quick test myself and experienced the same. Both that node_modules/ava/cli.js no longer works, and that the setting does not persist between restarts. Will look into it when I have some free time. Thanks or the report!

eirikb commented 1 year ago

Quick update: Wasn't able to run the project with 2022.3.1 as target 😅 It works fine with 2021.2, but if I bump to 2021.2.1 (or greater) I get this error:

Cannot find builtin plugin JavaScript for IDE

Will try again later.

eirikb commented 1 year ago

Didn't mean to close it. I've had another look now, and it seems newer versions of AVA has already been added support for here: https://github.com/eirikb/AvaJavaScriptTestRunnerRunConfigurationGenerator/blob/main/src/main/kotlin/no/eirikb/avatest/actions/AvaJavaScriptTestRunnerRunConfigurationGenerator.kt#L160
The reason it failed for you (and me when testing) was probably because of AVA upgrade on the same project, and since the settings didn't work properly the settings pointed to the wrong executable. Using node_modules/.bin/ava seems to work fine, but it didn't before, which is why it is the way it is now (with two options).

Why it doesn't persist I do not know. But I have updated the build config based on the template one, and then it persisted when I tested. So that might have fixed it. Will push a new version that you can test (1.10.0)

klindklind commented 1 year ago

Thanks for this! Now the configuration is persisted between restarts.

By the way, I noticed that IntelliJ for some reason doesn't find updates for this plugin. I'm running the latest IntelliJ IDEA 2022.3.2 but when I ran the "Check for updates" I don't get updates for this plugin although I was running the version 1.4.1 which is for the 2021 IDEA versions and a very old one 🤷‍♂️

klindklind commented 1 year ago

And the 1.4.1 keeps coming back when I reinstalled via IntelliJ IDEA plugins Marketplace. This is what I get for IDEA 2022.3.2

image

(not related to this particular issue though)

eirikb commented 1 year ago

Are you still seeing only 1.4.1? I should be updated to latest, and I've removed the old versions.

The version mismatch happened because old version of the plugin used '*' as target IntelliJ version, while new version uses specific version.

klindklind commented 1 year ago

Now it works! Got the latest plugin and run configuration is persisted during IDE restart. Thanks a lot 🙏