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

Handles Pest filters #137

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Conversation

joedixon
Copy link
Contributor

No description provided.

@calebporzio calebporzio merged commit a920e47 into calebporzio:master Oct 10, 2023
1 of 2 checks passed
@amadeann
Copy link

@joedixon
I don't have pest installed, and when I try to run tests tests I get the following error:
c:/laragon/www/m_project_name/vendor/bin/pest.bat : The term 'c:/laragon/www/m_project_name/vendor/bin/pest.bat' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I am on Windows 11.

@amadeann
Copy link

When I remove pestphp/pest-plugin": true line from composer.json and reopen VS Code tests run again. Since pestphp/pest-plugin": true is a part of Laravel's default install, this will trip everybody up unless they use pest too. Maybe there is another way to detect if pest is in use?

@joedixon
Copy link
Contributor Author

Hey @amadeann can you double check your composer.json?

The Pest binary will only be used if pestphp/pest is present.

@amadeann
Copy link

amadeann commented Oct 11, 2023

@joedixon
Yes, I have checked it. I had "pestphp/pest-plugin": true in config.allow-plugins, which is a part of laravel/laravel default composer.json (this line).

Once I removed that line, and reloaded VS Code, the plugin works as usual.

The problem is that this line:
const isPest = fs.readFileSync(composerJson, 'utf8').includes('pestphp/pest');

matches anything in composer.json file that contains pestphp/pest, even if it's just an allowed-plugin added by default in Laravel installer.

@joedixon
Copy link
Contributor Author

@amadeann good catch. I'll submit a PR to make this check a little more explicit.

@joedixon joedixon deleted the fix/pest-filter branch October 11, 2023 07:01
@joedixon
Copy link
Contributor Author

@amadeann think this should do it: #138

@amadeann
Copy link

Works as before with the new version :)

@joedixon
Copy link
Contributor Author

@amadeann to confirm, you mean before you ran into the issue? i.e. it's working as expected?

@amadeann
Copy link

@joedixon
Yes, works as expected with your fix from yesterday. Sorry it wasn't clear from my message.

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.

3 participants