Skip to content

Conversation

@felixarntz
Copy link
Member

I randomly discovered this package the other day, and it looks awesome - love what y'all are building here! I started using it right away, although I realize it's early. :)

What?

When using wp-build on a project that has JS/TS tests where files are colocated with their source files (e.g. /src/panel.test.ts tests /src/panel.ts), the test files will currently be included in the output build dir.

Why?

An exclusion for them is missing in IGNORE_PATTERNS. They're already ignored elsewhere, and other tests (entire folders) are already part of IGNORE_PATTERNS, so maybe this is just a missing piece.

Testing Instructions

  1. Add some tests in a *.test.ts or *.test.js file next to your source file.
  2. Run wp-build.
  3. Compare the resulting build folder with and without this PR: Without, the *.test.js file will show - with, it won't (which is what we want).

@felixarntz felixarntz added the [Type] Build Tooling Issues or PRs related to build tooling label Nov 21, 2025
@github-actions
Copy link

Flaky tests detected in 00c8b38.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19585254066
📝 Reported issues:

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: felixarntz <[email protected]>
Co-authored-by: youknowriad <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@felixarntz felixarntz merged commit 1e55ca2 into trunk Nov 24, 2025
38 of 39 checks passed
@felixarntz felixarntz deleted the fix/exclude-test-files-from-build branch November 24, 2025 15:37
@github-actions github-actions bot added this to the Gutenberg 22.2 milestone Nov 24, 2025
'**/*.native.*',
'**/*.ios.*',
'**/*.android.*',
'**/*.{spec,test}.*',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to sync "spec" variations into the entry above aimed at test folders, since I've also seen spec folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants