test(core,common): register chai-as-promised in async-rejection specs#16973
Closed
HarrierOnChain wants to merge 1 commit into
Closed
Conversation
Coverage Report for CI Build 0Coverage remained the same at 89.908%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Member
Contributor
Author
|
Could you tell me what the problem is? |
Member
|
we are removing chai in the next release (altogether), the PR i shared will be merged soon |
Contributor
Author
|
oh, great choice |
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.
Several spec files use chai-as-promised idioms (.rejectedWith, .fulfilled, .eventually) without calling chai.use(chaiAsPromised) in the file. Today these tests still pass in npm run test because some other spec alphabetically earlier in the glob registers the plugin, and the registration leaks into the shared chai instance for subsequent files.
Running any of these specs in isolation (e.g. mocha packages/core/test/scanner.spec.ts) fails with Invalid Chai property: rejectedWith. The assertion silently returns undefined, so the tests pass without actually asserting anything.
This PR follows the existing convention used by injector.spec.ts, middleware-module.spec.ts, and others: each affected spec now imports and registers chai-as-promised itself. 13 previously inert assertions across 8 files now actually run.