• Hello everyone,

    recently I got into the WordPress plugin development. After fiddling around a bit, I landed on the blocks/Gutenberg based approach to plugin development.

    My plugin consists of two blocks that are working well. The only thing that I’m missing, is a consistent testing strategy. I am already aware of wp-env, wp-cli (and the integration with wp-env) and the wp-scripts unit testing capabilities.

    What I’m missing is a setup for e2e testing (I would like to keep that at a minimum though).

    My questions are:

    • What are the best practices to setting up a development and e2e-test environment for plugin development?
    • I’ve tried to use wp-env (which worked great) and setup the wordpress instance with data required for testing with wp-env run cli wp ... (which worked not great at all). How do I prepare the development and test instances provided by wp-env most effectively?
    • Is it possible to use wp-env run cli wp eval-file ... with a file that is outside of the plugin codebase? (or: can I provide any additions mounts to the cli docker container?)

    If there is a best practices documentation ready available, I failed to find it. If so, please feel free to direct me towards that documentation.

    • This topic was modified 2 years, 5 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Testing with wp-scripts and wp-env’ is closed to new replies.