test(sdk): await rejects assertions in loadSourceConfig - #3318
Closed
rajanpanth wants to merge 1 commit into
Closed
Conversation
Three tests asserted on rejection without awaiting, so the assertions never ran and the tests could not fail. Vitest already warns that this breaks in Vitest 3.
rajanpanth
requested a deployment
to
Approval required to run action on external PR
August 20, 2026 01:23 — with
GitHub Actions
Waiting
Author
|
Closing this: the restructure superseded it.
The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three tests in
loadSourceConfig.spec.jsassert on a rejected promise without awaiting it:The assertion is never awaited, so it does not run before the test ends. All three tests are named "should throw …" and none of them can currently fail. Vitest already flags it when the suite runs:
So this is also forward-breaking, not just dead coverage.
The neighbouring tests in the same file already use
awaitcorrectly (expect(await loadConnectionOptions(...)).toEqual(...)), so this looks like an oversight rather than intent.Verification. All 13 tests in the file pass with the awaits added, and the three Vitest warnings are gone. To confirm the assertions are now actually live, I changed one expected message to a string that cannot match and re-ran: that test failed, as it should. Before the change, the same mutation still passed. Reverted afterwards.
I scanned the rest of the repo for the same pattern and this file was the only occurrence.
prettier --checkpasses on the changed file.