Skip to content

Chai update / Karma-Tree-Shaking#285

Merged
phillipc merged 7 commits intomainfrom
pc/chai_sinon_update
Apr 6, 2026
Merged

Chai update / Karma-Tree-Shaking#285
phillipc merged 7 commits intomainfrom
pc/chai_sinon_update

Conversation

@phillipc
Copy link
Copy Markdown
Member

@phillipc phillipc commented Apr 6, 2026

  • Update Chai and Mocha
  • Remove old Chai and Sinon Karma-Plugin
  • Chai and Sinon will load now as ESM

Summary by CodeRabbit

  • Chores
    • Updated test tooling and dev-dependency versions for the test suite; streamlined test runner configuration across packages.
  • Tests
    • Updated test modules to use explicit assertion imports and adjusted test setup to align with the simplified test runner configuration.

dependabot bot and others added 3 commits April 5, 2026 20:49
Bumps [chai](https://github.com/chaijs/chai) from 4.5.0 to 6.2.2.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](chaijs/chai@v4.5.0...v6.2.2)

---
updated-dependencies:
- dependency-name: chai
  dependency-version: 6.2.2
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@phillipc phillipc requested a review from brianmhunt April 6, 2026 09:35
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

📝 Walkthrough

Walkthrough

Karma test framework configs were simplified to mocha across the repo; devDependencies updated (chai and mocha versions) and karma-chai/karma-sinon removed. Test files were changed to import chai assertion helpers explicitly.

Changes

Cohort / File(s) Summary
Root Dependencies
package.json
Bumped chai to ^6.2.2 and mocha to ^11.7.5; removed karma-chai and karma-sinon devDependencies.
Test File Imports
builds/reference/spec/bindingGlobalsBehavior.js, builds/reference/spec/iifeBehavior.js, builds/reference/spec/rootImportBehavior.js
Added explicit chai imports (expect / assert) to tests to replace reliance on global/framework-provided assertions.
Karma Framework Configuration
builds/reference/package.json, packages/.../package.json
packages/binding.foreach/package.json, packages/lifecycle/package.json, packages/provider.attr/package.json, packages/provider.bindingstring/package.json, packages/provider.databind/package.json, packages/provider.multi/package.json, packages/provider.native/package.json, packages/provider.virtual/package.json, packages/provider/package.json, packages/utils.functionrewrite/package.json, packages/utils.jsx/package.json, packages/utils.parser/package.json
Removed chai (and sinon where present) from karma.frameworks, leaving only mocha.
Karma Configuration File
tools/karma.conf.js
Minor whitespace adjustment after the files array closing bracket; no functional changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐰✨ I hopped through configs, neat and spry,
Pruned frameworks down to mocha's sky.
Chai imports now greet each test,
No globals lingering in the nest.
Rabbit cheers—builds run light and high!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: updating Chai and removing Karma framework plugins (tree-shaking) to load Chai as an ESM module instead.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pc/chai_sinon_update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@phillipc phillipc changed the title POC: chai sinon update POC: chai update Apr 6, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@builds/reference/spec/bindingGlobalsBehavior.js`:
- Line 2: The import statement "import { expect } from 'chai';" includes a
trailing semicolon that violates the Prettier "no semicolons" rule; remove the
semicolon from that import (the line referencing expect) so it reads without the
trailing ";" to comply with the project's Prettier configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 086f6a8c-1934-498a-8814-046884bfe78f

📥 Commits

Reviewing files that changed from the base of the PR and between 42382af and 4a13ea5.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • builds/reference/package.json
  • builds/reference/spec/bindingGlobalsBehavior.js
  • builds/reference/spec/iifeBehavior.js
  • builds/reference/spec/rootImportBehavior.js
  • package.json
  • packages/binding.foreach/package.json
  • packages/lifecycle/package.json
  • packages/provider.attr/package.json
  • packages/provider.bindingstring/package.json
  • packages/provider.databind/package.json
  • packages/provider.multi/package.json
  • packages/provider.native/package.json
  • packages/provider.virtual/package.json
  • packages/provider/package.json
  • packages/utils.functionrewrite/package.json
  • packages/utils.jsx/package.json
  • packages/utils.parser/package.json
  • tools/karma.conf.js

@phillipc phillipc changed the title POC: chai update Chai update / Karma-Tree-Shaking Apr 6, 2026
@phillipc phillipc merged commit c610534 into main Apr 6, 2026
7 checks passed
@phillipc phillipc deleted the pc/chai_sinon_update branch April 6, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant