Problem
As the pest plugin for IntelliJ is getting more and more love, we want to add support for tests without names.
However this raises the problem of what to show in IntelliJ.
We therefore need to know how to generate the name and for that logic to be the same in pest and in the plugin.
Solutions
There are multiple ways to make sure this logic is the same.
-
Having an API in Pest to generate the name.
This is a nice way for pest, as how we generate can change without any further impact. The problem is then that the plugin will be rather slow as it now has to run php for getting a tests name.
-
Having a formalised name generation in text.
For this we write some text that defines how the naming generation works and then we implement that in both PHP and the IntelliJ plugin. When the generation has to change, the official definition is then updated and then we have to update both implementations.
This is a rather cumbersome process, but okay as the generation might not change that often.
-
Having a standard defined as regex.
Basically we create a regex which can generate the name of the test. This would mean one implementation as it is just a regex. However the problem here is that regex might not be able to do all the things we need to do.
Any thought or other solutions?
Problem
As the pest plugin for IntelliJ is getting more and more love, we want to add support for tests without names.
However this raises the problem of what to show in IntelliJ.
We therefore need to know how to generate the name and for that logic to be the same in pest and in the plugin.
Solutions
There are multiple ways to make sure this logic is the same.
Having an API in Pest to generate the name.
This is a nice way for pest, as how we generate can change without any further impact. The problem is then that the plugin will be rather slow as it now has to run php for getting a tests name.
Having a formalised name generation in text.
For this we write some text that defines how the naming generation works and then we implement that in both PHP and the IntelliJ plugin. When the generation has to change, the official definition is then updated and then we have to update both implementations.
This is a rather cumbersome process, but okay as the generation might not change that often.
Having a standard defined as regex.
Basically we create a regex which can generate the name of the test. This would mean one implementation as it is just a regex. However the problem here is that regex might not be able to do all the things we need to do.
Any thought or other solutions?