Repository navigation
feat(config): add configurable WP-CLI command for wp-env 11+ - #31
Merged
Merged
Conversation
Add wpCliCommand option to getPlaywrightConfig, wpEnvRun helper, and update createTranslator to use the shared command resolution.
…rver Destructure use and webServer out of options before spreading playwrightOptions so merged defaults are not replaced wholesale.
Aligns with getWpCliCommand/setWpCliCommand and verb-first naming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
wpCliCommandoption togetPlaywrightConfig()for wp-env 11+ setups using.wp-env.test.jsonrunWpCli()andgetWpCliCommand()helpers for running WP-CLI commands in the test environmentcreateTranslator()to use the configurable command instead of a hardcodedtests-clicontainergetPlaywrightConfig()so spreading remaining Playwright options no longer overwrites mergeduseandwebServerdefaultswpCliCommand,runWpCli, andgetWpCliCommand()in READMEWhy?
wp-env 11+ deprecates the built-in
tests-clicontainer in favor of separate config files (e.g..wp-env.test.jsonwithrun cli). Consumer projects were duplicatingrunWpClihelpers andcreateTranslatorwas failing against the new setup.How?
getPlaywrightConfig({ wpCliCommand })setsWP_ENV_CLI_COMMANDat config load timegetWpCliCommand()resolves the base command fromWP_ENV_CLI_COMMANDor falls back tonpx wp-env run tests-clirunWpCli(command, shellPrefix?)runs WP-CLI via the resolved commandsetWpCliCommand()remains internal to the package (not publicly exported)use,webServer, andwpCliCommandare destructured out of options before spreading remaining Playwright optionsTest plan
npm run buildpassesnpm run lint:jspasseswpCliCommand: 'npx wp-env --config=.wp-env.test.json run cli'andcreateTranslator()succeedsrunWpClihelper with the package export