Skip to content

Conversation

Copy link

Copilot AI commented Dec 22, 2025

Migrates from chai@4 to chai@6, following the pattern established in bpmn-js-token-simulation#176.

Changes

  • Created test/globals.js to wire chai and sinon-chai together via chai's use() function
  • Imported globals module in test entry point to ensure setup runs before tests
  • Removed sinon-chai from karma frameworks (now handled via explicit wiring)
  • Added webpack sideEffects rule for globals module to prevent tree-shaking
  • Added explicit import { expect } from 'chai' in all test files that use chai assertions
// test/globals.js
import { use } from 'chai';
import sinonChai from 'sinon-chai';

use(sinonChai);

This explicit wiring and importing approach is required because chai@6 no longer auto-registers plugins globally in bundled environments.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Dec 22, 2025
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

* explicitly depend on chai and sinon where needed
* wire both together using a globals.js file that is imported
  with the bundle
* workaround tree-shaking so it is not accidentally optimized away

Co-authored-by: nikku <[email protected]>
Copy link
Author

Copilot AI commented Dec 22, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • googlechromelabs.github.io
    • Triggering command: /usr/local/bin/node node install.mjs (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.264/linux64/chrome-headless-shell-linux64.zip
    • Triggering command: /usr/local/bin/node node install.mjs (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update test dependencies to major versions chore: migrate to chai@6 Dec 22, 2025
Copilot AI requested a review from nikku December 22, 2025 12:36
@nikku
Copy link
Member

nikku commented Dec 22, 2025

@copilot Please ensure we explicitly import chai and sinon where previously used as a global, i.e. add import { expect } from 'chai' in every file that consumes expect

Import expect from chai in test files instead of relying on globals

Co-authored-by: nikku <[email protected]>
Copy link
Author

Copilot AI commented Dec 22, 2025

@copilot Please ensure we explicitly import chai and sinon where previously used as a global, i.e. add import { expect } from 'chai' in every file that consumes expect

Done! Added explicit import { expect } from 'chai'; to both test files that use expect (7b01c3c):

  • test/spec/LintingSpec.js
  • test/distro/distroSpec.js

@nikku nikku force-pushed the renovate/major-test branch from a1ef10d to 7ac2b53 Compare December 22, 2025 14:23
@nikku nikku closed this Dec 22, 2025
@bpmn-io-tasks bpmn-io-tasks bot removed the in progress Currently worked on label Dec 22, 2025
@nikku
Copy link
Member

nikku commented Dec 22, 2025

Incorporated into #76

@nikku nikku deleted the copilot/sub-pr-76 branch December 22, 2025 14:23
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.

3 participants