Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Pest support #136

Merged
merged 8 commits into from
Oct 10, 2023
Merged

Adds Pest support #136

merged 8 commits into from
Oct 10, 2023

Conversation

joedixon
Copy link
Contributor

@joedixon joedixon commented Oct 10, 2023

I've been running into some issues when attempting to use the Better PHPUnit and Better Pest plugins at the same time. Tests are taking ~5 seconds to start.

I did some digging and it appears something has changed in VS Code which triggers both plugins to activate when running either command (e.g. better-phpunit.run or better-pest.run).

I used my best Sherlock skills, but was not able to determine what VS Code was doing under the hood to trigger it.

So instead, I thought...

"Why not just add support for Pest to Better PHPUnit - that way I only need one plugin and the issue is resolved."

My idea here was to read the composer.json and if pestphp/pest is present, use the pest binary, otherwise, use the phpunit binary.

The actual execution was pretty simple:

Screenshot 2023-10-10 at 10 49 07

However, it turns out VS Code have completely rewritten the way tests work and so I had to go through the process of migrating from the vscode module to @vscode/test-electron.

This also meant targeting a new version of VS Code. I'm not sure whether this has any impact for existing users? I assume it could be if their installation of VS Code is outdated. Wondering if maybe it warrants a new major version should this get merged.

Seeing as I went to the effort of migrating the tests, I figured I may as well also get them running in CI.

To run the tests locally should be a case of npm install && npm run test.

So that's the story of how PR with 2 file changes became a PR with 17 file changes... Sorry!

@calebporzio calebporzio merged commit 22661a5 into calebporzio:master Oct 10, 2023
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