Skip to content

feat: add harness-based jest runner#4

Merged
V3RON merged 1 commit into
mainfrom
feat/jest
Oct 16, 2025
Merged

feat: add harness-based jest runner#4
V3RON merged 1 commit into
mainfrom
feat/jest

Conversation

@V3RON

@V3RON V3RON commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Catching up with Jest, which has been under development for years, isn't easy (especially for a team with only a single developer). Therefore, it may make more sense to adopt Jest and use it as a CLI for Harness. This pull request implements a custom Jest runner based on Harness, capable of running tests on emulators, just like the Harness CLI.

With this approach, there's no need to maintain a separate CLI, and we can leverage the existing infrastructure for reports and other integrations. For example, I was able to set up test coverage support in just a few minutes, rather than hours.

@vercel

vercel Bot commented Oct 16, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
react-native-harness Ready Ready Preview Comment Oct 16, 2025 11:44am

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on November 2

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

failureDetails: [],
failureMessages: actualErrorMessage ? [actualErrorMessage] : [],
fullName: jestTestPath || test.testPath || '',
numPassingAsserts: test.errorMessage ? 1 : 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Test Result Logic Inverted

The numPassingAsserts logic is inverted. It currently sets numPassingAsserts to 1 when test.errorMessage exists (failed test) and 0 when it doesn't (passed test), which is the opposite of expected.

Fix in Cursor Fix in Web

harness.environment.restart();
});
}
isFirstTest = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Event Listener Timing Issue

A race condition exists where the 'ready' event listener is attached after harness.environment.restart() is called. If the environment becomes ready quickly, the event can be missed, causing the test runner to hang indefinitely. This wait also lacks timeout or error handling.

Fix in Cursor Fix in Web

@V3RON V3RON merged commit 0840f3f into main Oct 16, 2025
3 of 4 checks passed
@V3RON V3RON deleted the feat/jest branch October 22, 2025 07:54
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