Repository navigation
chore(deps-dev): upgrade chai and related plugins to ESM versions - #3270
Conversation
There was a problem hiding this comment.
Code Review
This pull request upgrades chai and its related testing libraries (such as chai-as-promised, chai-exclude, and sinon-chai) to newer major versions, updating import patterns across numerous test files. The review feedback highlights that @types/chai is now redundant due to built-in types in Chai v5/v6 and should be removed. Additionally, several test files unnecessarily import chai/register-should despite only using expect assertions, which pollutes the global prototype and should be cleaned up.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request upgrades Chai to v6, along with its related plugins and type definitions, and updates test files to import 'chai/register-should' and use default imports for 'chai-as-promised' and 'sinon-chai'. The review feedback highlights a potential TypeScript conflict where '@types/chai' might still be transitively installed by other type packages, suggesting using npm overrides or tsconfig paths to resolve it. Additionally, it is recommended to add the 'chai/register-should' import to 'test/unit/phone-number-verification/token-verifier.spec.ts' for consistency and isolated test execution.
| "@firebase/auth-types": "^0.13.1", | ||
| "@microsoft/api-extractor": "^7.11.2", | ||
| "@types/bcrypt": "^6.0.0", | ||
| "@types/chai": "^4.0.0", |
There was a problem hiding this comment.
The pr description mentions upgrading @types/chai (^4.0.0 -> ^5.2.3) but it seems to remove it here without bumping?
There was a problem hiding this comment.
Oh yeah, the review bot asked me to remove it haha
Thanks!
# Conflicts: # package-lock.json
chai(^4.2.0->^6.2.2)chai-as-promised(^7.0.0->^8.0.2) and@types/chai-as-promised(^7.1.0->^8.0.2)sinon-chai(^3.0.0->^4.0.1) and@types/sinon-chai(^3.0.0->^4.0.0)chai-exclude(^2.1.0->^3.0.1)sinon-chaiandchai-as-promisedimports across test files from namespace imports (import * as ...) to default imports (import ...).chai/register-shouldin test files that use.shouldassertions so the globalObject.shouldtype augmentation (moved out of@types/chai/index.d.tsin v5) is registered.