Skip to content

Use vi.waitFor in app event watcher test - #7845

Merged
alfonso-noriega merged 1 commit into
mainfrom
06-17-use_vi.waitfor_in_app_event_watcher_test
Jun 17, 2026
Merged

alfonso-noriega merged 1 commit into
mainfrom
06-17-use_vi.waitfor_in_app_event_watcher_test

Conversation

@alfonso-noriega

@alfonso-noriega alfonso-noriega commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Fixes N/A

app-event-watcher.test.ts had a hand-rolled polling loop using setTimeout to wait for async watcher emissions. Using Vitest's built-in wait helper makes the test easier to read and avoids maintaining custom timer logic.

WHAT is this pull request doing?

Replaces the custom new Promise / setTimeout polling loop with vi.waitFor while preserving the same timeout and polling interval semantics. The assertions still wait for both all and ready events before continuing.

How to test your changes?

Validated locally from ~/worktrees/cli-use-vi-waitfor-app-event-watcher:

pnpm install --frozen-lockfile
pnpm --filter @shopify/app vitest src/cli/services/dev/app-events/app-event-watcher.test.ts --run
pnpm --filter @shopify/app lint
NX_SKIP_NX_CACHE=true pnpm --filter @shopify/app type-check
git diff --check

Post-release steps

None.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • This change is not user-facing, so no changeset is required

Assisted-By: devx/aa6f2838-a296-4af6-ae5b-25654e978e0a
@alfonso-noriega
alfonso-noriega requested a review from a team as a code owner June 17, 2026 12:37

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jun 17, 2026
@alfonso-noriega
alfonso-noriega added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit 76ba05a Jun 17, 2026
29 checks passed
@alfonso-noriega
alfonso-noriega deleted the 06-17-use_vi.waitfor_in_app_event_watcher_test branch June 17, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants