[PR #5450] test(cli): stabilize async test assertions with proper await #5214

Open
opened 2026-03-17 02:40:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5450
Author: @Golenspade
Created: 10/5/2025
Status: 🔄 Open

Base: mainHead: test/cli-vitest-stabilize


📝 Commits (1)

  • 6ca093e test(cli): add missing await to async test assertions

📊 Changes

1 file changed (+6 additions, -6 deletions)

View changed files

📝 packages/hoppscotch-cli/src/__tests__/unit/getters.spec.ts (+6 -6)

📄 Description

Summary

Fixes missing await keywords in async test assertions that were causing Vitest warnings and would fail in Vitest 3.

Changes

  • Added async keyword to test callbacks in getters.spec.ts
  • Added await to expect().rejects assertions
  • Fixed test.each() callback to be async

Fixed Warnings

  • Eliminated 10 warnings: Promise returned by expect().rejects was not awaited
  • Prevents future failures when upgrading to Vitest 3

Testing

  • pnpm --filter @hoppscotch/cli test passes without warnings
  • All 89 tests pass (1 skipped)
  • No new test failures introduced
  • Refs #4160
  • Part of ongoing CLI test stabilization effort started in #4657

Note: This PR focuses only on fixing async/await issues. The one existing test failure (coll-v2-req-v2) is a separate functional issue, not related to these test infrastructure improvements.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5450 **Author:** [@Golenspade](https://github.com/Golenspade) **Created:** 10/5/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/cli-vitest-stabilize` --- ### 📝 Commits (1) - [`6ca093e`](https://github.com/hoppscotch/hoppscotch/commit/6ca093ebb2162b1fb4f7931ed79c9413c3d56ea8) test(cli): add missing await to async test assertions ### 📊 Changes **1 file changed** (+6 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-cli/src/__tests__/unit/getters.spec.ts` (+6 -6) </details> ### 📄 Description ## Summary Fixes missing `await` keywords in async test assertions that were causing Vitest warnings and would fail in Vitest 3. ## Changes - Added `async` keyword to test callbacks in `getters.spec.ts` - Added `await` to `expect().rejects` assertions - Fixed `test.each()` callback to be async ## Fixed Warnings - ✅ Eliminated 10 warnings: `Promise returned by expect().rejects was not awaited` - ✅ Prevents future failures when upgrading to Vitest 3 ## Testing - `pnpm --filter @hoppscotch/cli test` passes without warnings - All 89 tests pass (1 skipped) - No new test failures introduced ## Related - Refs #4160 - Part of ongoing CLI test stabilization effort started in #4657 --- **Note**: This PR focuses only on fixing async/await issues. The one existing test failure (`coll-v2-req-v2`) is a separate functional issue, not related to these test infrastructure improvements. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5214
No description provided.