Skip to content

fix: skip browser plugin install steps when it's already installed - #20

Open
cjmellor wants to merge 1 commit into
pestphp:5.xfrom
cjmellor:fix/browser-guideline-gate
Open

cjmellor wants to merge 1 commit into
pestphp:5.xfrom
cjmellor:fix/browser-guideline-gate

Conversation

@cjmellor

Copy link
Copy Markdown

What:

  • Bug Fix
  • New Feature

Description:

We use this plugin with Boost in a Laravel app that already has pestphp/pest-plugin-browser installed. The generated guidelines still told the agent to ask before installing it and listed the composer/npm/npx commands, which is about 15 lines every agent reads for nothing.

This wraps the install part in @if (! \Composer\InstalledVersions::isInstalled('pestphp/pest-plugin-browser')). The visit() intro and the example commands still render either way. I shortened the heading to "Browser checks require the browser plugin" since it now shows in both cases. The "ask the user for permission first" line is still there when the plugin is missing.

I went with InstalledVersions over $assist->hasPackage() because hasPackage() only takes a package name string from Boost 2.5.0. On 2.4.x, which you can still get with Pest 5.0.3 to 5.1.2, it throws and boost:install fails. I checked boost:install and boost:update on Boost 2.4.13 and 2.10.3, with and without the browser plugin.

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.

1 participant