Skip to content

chore(deps-dev): upgrade chai and related plugins to ESM versions - #3270

Merged
lahirumaramba merged 6 commits into
mainfrom
lm-upgrade-chai
Oct 7, 2026
Merged

lahirumaramba merged 6 commits into
mainfrom
lm-upgrade-chai

Conversation

@lahirumaramba

@lahirumaramba lahirumaramba commented Oct 6, 2026 •

Copy link
Copy Markdown
Member
  • Upgrade chai (^4.2.0 -> ^6.2.2)
  • Upgrade companion Chai plugins and type definitions required for Chai v5/v6 compatibility:
    • 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)
  • Update sinon-chai and chai-as-promised imports across test files from namespace imports (import * as ...) to default imports (import ...).
  • Import chai/register-should in test files that use .should assertions so the global Object.should type augmentation (moved out of @types/chai/index.d.ts in v5) is registered.

@lahirumaramba
lahirumaramba requested a review from a team October 6, 2026 23:37
@lahirumaramba lahirumaramba added the release:stage Stage a release candidate label Oct 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread package.json
Comment thread test/unit/database/database.spec.ts Outdated
Comment thread test/unit/utils/index.spec.ts Outdated
Comment thread test/unit/data-connect/data-connect-api-client-internal.spec.ts Outdated
Comment thread test/integration/security-rules.spec.ts Outdated
@lahirumaramba

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread package.json
Comment thread test/unit/phone-number-verification/token-verifier.spec.ts

@yvonnep165 yvonnep165 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nit!

Comment thread package.json
"@firebase/auth-types": "^0.13.1",
"@microsoft/api-extractor": "^7.11.2",
"@types/bcrypt": "^6.0.0",
"@types/chai": "^4.0.0",

@yvonnep165 yvonnep165 Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pr description mentions upgrading @types/chai (^4.0.0 -> ^5.2.3) but it seems to remove it here without bumping?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, the review bot asked me to remove it haha
Thanks!

@lahirumaramba
lahirumaramba merged commit 5621b5b into main Oct 7, 2026
20 checks passed
@lahirumaramba
lahirumaramba deleted the lm-upgrade-chai branch October 7, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:stage Stage a release candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants