Skip to content

[Feature Request]: Build Assets during Integration Tests Running #255

Description

@widoz

Is your feature request related to a problem?

As a developer I use the PhpUnit Integration Library to be able to write integration tests, and in some circumnstances I've found my self in the need to perform tests where blocks are involved.

Right now it is not possible to test anything related to the blocks because assets are not compiled during the Integration Tests running.

In some other cases the test suite would not run at all because depending on how the blocks are being registered the file blocks-manifest.php might be miss, making WP crashing.

Note
While it is true most of the tests involving the blocks would be performed via e2e tests, still, there are valid cases for which we want to tests blocks and blocks related aspects.

  • Ensure we always have the same output (critical for certain clients)
  • Ensure all relative elements are properly registered
  • Ensure files are where they are supposed to be
  • Ensure all configuration for blocks are there when necessary (e.g. Interactivity Api directives)

The e2e tests mostly focus on the user interaction, i. e. behaviour of the components, plus, most of the time them are not automated.

Integrating the possibility to test blocks from an integrative point of view would give developers an additional tool they are providing a valid solution and that solution is not causing issues to other areas of the project.

Describe the desired solution

As a developer I'd like to have the possibility to build the project assets automatically whenever the PhpUnit Integration Action is running.

Describe the alternatives that you have considered

Alternative solutions involve not boostrapping project modules if certain files are missed e.g. blocks-manifest.php, though this is not a viable solution but more a workaround since it would hide or make more difficult to properly maintain the project it self.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions