Skip to content

Improve WebStorm test-runner support - #180

Merged
43081j merged 2 commits into
e18e:mainfrom
ashleylamont:ashleylamont/webstorm-test-runner-support
Oct 27, 2026
Merged

43081j merged 2 commits into
e18e:mainfrom
ashleylamont:ashleylamont/webstorm-test-runner-support

Conversation

@ashleylamont

Copy link
Copy Markdown
Contributor

Currently, if you open this repo in WebStorm, it can't statically analyse the rule test files or mark them as runnable, so context-menu actions and gutter icons don't appear for those tests.

This makes testing in WebStorm more difficult than it needs to be.

This PR adds describe wrappers to each of those test cases, which give WebStorm enough context to detect that tests are present and to let the user run them (for the whole suite, though not individual cases) accordingly.

This means that WebStorm now shows users context-menu actions and test gutter icons, and generally handles the tests better.

image image

This PR also adds two default Run Configurations for IntelliJ/Webstorm users that provide an out-of-the-box configuration to:

  • Run all unit tests excluding oxlint integration
  • Build the project with npm, then run the oxlint integration tests

…an produce gutter run icons. Additionally, add WebStorm run configurations for oxlint and unit tests.
@43081j

43081j commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

this seems unfortunate 👀 the rule tester itself creates the right context, so this seems like a bit of a hack to get an editor to be happy with that...

this seems better solved in a webstorm plugin of some sort, to make it aware of RuleTester tests

@ashleylamont

Copy link
Copy Markdown
Contributor Author

this seems unfortunate 👀 the rule tester itself creates the right context, so this seems like a bit of a hack to get an editor to be happy with that

Agreed 😅 Unfortunately it doesn't seem like JetBrains is in any hurry to get that sorted though. There's been an open feature request for this for several years with no activity https://youtrack.jetbrains.com/issue/WEB-40108

this seems better solved in a webstorm plugin of some sort, to make it aware of RuleTester tests

🤔 I'll have a look at writing a plugin, from a quick glance it seems like it is probably somewhat feasible. Sounds like you'd rather direct WebStorm users towards something like that rather than this? (totally fine if so, just want to check I'm understanding correctly 😄)

Would you be open to accepting a reduced PR with just the project run configurations instead, with all of the describe additions removed?

@ashleylamont

Copy link
Copy Markdown
Contributor Author
image

Ok yep, a plugin should be able to do the trick :)

@ashleylamont

ashleylamont commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

I've removed everything other than the run configs, now that a plugin is viable instead 🫡

@43081j
43081j merged commit 96ff582 into e18e:main Oct 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants