Skip to content

fix: handle expect.soft in Harness runtime#105

Merged
V3RON merged 4 commits intomainfrom
fix/expect
Apr 17, 2026
Merged

fix: handle expect.soft in Harness runtime#105
V3RON merged 4 commits intomainfrom
fix/expect

Conversation

@V3RON
Copy link
Copy Markdown
Contributor

@V3RON V3RON commented Apr 17, 2026

Summary

  • make expect.soft work correctly in the Harness runtime by wiring Vitest's per-test expectation context during test execution
  • preserve the original soft assertion stack so Metro highlights the user assertion instead of Harness internals
  • keep internal Metro frame collapsing scoped to installed @react-native-harness/* packages and document the current expect.soft reporting limitation

Verification

  • pnpm nx build @react-native-harness/runtime
  • pnpm nx build @react-native-harness/bundler-metro
  • pnpm nx test @react-native-harness/runtime
  • pnpm vitest run src/tests/withRnHarness.test.ts
  • pnpm harness ./src/tests/smoke.harness.ts

Limitation

  • when multiple soft assertions fail in one test, Harness reports all failure messages, but only the first failure currently contributes the highlighted stack trace and code frame

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-harness Ready Ready Preview, Comment Apr 17, 2026 8:20am

Request Review

@V3RON V3RON changed the title fix: preserve soft assertion callsites fix: handle expect.soft in Harness runtime Apr 17, 2026
@V3RON V3RON mentioned this pull request Apr 17, 2026
@V3RON V3RON merged commit 221749b into main Apr 17, 2026
4 of 5 checks passed
@V3RON V3RON deleted the fix/expect branch April 17, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant