Skip to content

test: improve chromatic-e2e related tests#1273

Merged
codykaup merged 2 commits into
mainfrom
ari/test-improve-e2e-pkg-tests
Apr 8, 2026
Merged

test: improve chromatic-e2e related tests#1273
codykaup merged 2 commits into
mainfrom
ari/test-improve-e2e-pkg-tests

Conversation

@AriPerkkio
Copy link
Copy Markdown
Member

@AriPerkkio AriPerkkio commented Apr 7, 2026

Another split from #1252. Contains test improvements that are unrelated to --vitest feature itself.

  • Remove node:test imports. These are not run during Vitest test run.
  • Add hacky patchModulePath for "mocking" require.resolve. Feel free to point out if this is too hacky and should be removed. As far as I know, this is the only way to "mock" require.resolve.
  • Add more test cases to verify --playwright and --cypress options
📦 Published PR as canary version: 16.1.1--canary.1273.24121882580.0

✨ Test out this PR locally via:

npm install chromatic@16.1.1--canary.1273.24121882580.0
# or 
yarn add chromatic@16.1.1--canary.1273.24121882580.0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

📦 Package Size: 5732 KB
✅ Compared to main: 0 KB ad246ff (5732 KB)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.98%. Comparing base (ad246ff) to head (36f30f1).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1273      +/-   ##
==========================================
+ Coverage   77.37%   77.98%   +0.60%     
==========================================
  Files         189      189              
  Lines        3624     3624              
  Branches     1089     1089              
==========================================
+ Hits         2804     2826      +22     
+ Misses        705      686      -19     
+ Partials      115      112       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AriPerkkio AriPerkkio requested review from codykaup and jmhobbs April 7, 2026 06:44
@codykaup codykaup added patch Auto: Increment the patch version when merged skip-release Auto: Preserve the current version when merged labels Apr 7, 2026
Copy link
Copy Markdown
Contributor

@codykaup codykaup left a comment

Choose a reason for hiding this comment

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

Looks good! Just a couple non-blocking questions for you.

Comment thread node-src/tasks/build.test.ts Outdated
Comment thread node-src/tasks/build.test.ts Outdated
* it works. Internally `require.resolve` calls `Module._resolveFilename` so we
* can intercept it.
*/
function patchModulePath(from: string, to: string) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like this function exists in a couple places. Do you think it's worth pulling out into a shared function (similar to testLogger)?

If we do that, I would exclude it from our test coverage output as well!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good call. Addressed both findings in 36f30f1.

@AriPerkkio AriPerkkio requested a review from codykaup April 8, 2026 06:45
Copy link
Copy Markdown
Contributor

@codykaup codykaup left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

Comment thread .codacy.yaml
- 'CHANGELOG.md'
- 'vitest.no-threads.config.ts'
- '**/lib/testLogger.ts'
- '**/lib/testUtilities.ts'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for updating this too! 🎉

@codykaup codykaup added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit 186b70d Apr 8, 2026
22 checks passed
@codykaup codykaup deleted the ari/test-improve-e2e-pkg-tests branch April 8, 2026 16:48
@chromatic-ci-bot
Copy link
Copy Markdown
Collaborator

🚀 PR was released in v16.2.0 🚀

@chromatic-ci-bot chromatic-ci-bot added the released Verdict: This issue/pull request has been released label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Auto: Increment the patch version when merged released Verdict: This issue/pull request has been released skip-release Auto: Preserve the current version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants