Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): bump chai from 4.5.0 to 5.1.1 #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 30, 2024

Bumps chai from 4.5.0 to 5.1.1.

Release notes

Sourced from chai's releases.

v5.1.1

What's Changed

New Contributors

Full Changelog: chaijs/chai@v5.1.0...v5.1.1

v5.1.0

What's Changed

New Contributors

Full Changelog: chaijs/chai@v5.0.3...v5.1.0

v5.0.3

Fix bad v5.0.2 publish.

Full Changelog: chaijs/chai@v5.0.2...v5.0.3

v5.0.2

What's Changed

Full Changelog: chaijs/chai@v5.0.1...v5.0.2

v5.0.0

BREAKING CHANGES

  • Chai now only supports EcmaScript Modules (ESM). This means your tests will need to either have import {...} from 'chai' or import('chai'). require('chai') will cause failures in nodejs. If you're using ESM and seeing failures, it may be due to a bundler or transpiler which is incorrectly converting import statements into require calls.

... (truncated)

Commits

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Sep 30, 2024
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/chai-5.1.1 branch 2 times, most recently from 49df628 to 9a5a5e3 Compare September 30, 2024 11:25
@wjt
Copy link
Member

wjt commented Sep 30, 2024

 Exception during run: Error [ERR_REQUIRE_ESM]: require() of ES Module /opt/eos-activation-server/node_modules/chai/chai.js from /opt/eos-activation-server/test/api/activation.integration.js not supported.
Instead change the require of chai.js in /opt/eos-activation-server/test/api/activation.integration.js to a dynamic import() which is available in all CommonJS modules.

Yeah, I came across this the other week...

wjt and others added 2 commits September 30, 2024 20:17
This is necessary to update to Chai 5.x which dropped support for being
imported into CommonJS code, since ES6 modules are the more modern,
standardized module system.

This is all mostly boilerplate changes.

The one surprising change is that activation.unit.js and ping.unit.js used to
require() the module under test inside the describe() callback, rather than at
the top level. I can't see that moving it to the top level makes any
difference.

I think the two modules are wrong to have a top-level `redis` variable that is
set by a call to a function because if you call that function twice with two
different values you are changing the variable used by the routes returned from
the first call. But when they are imported is not relevant; it's the call to
the “class” (which in both cases is actually a factory function, and an arrow
function at that, not a class in the sense of the `class` keyword or of a
prototype-based function called with `new Foo()`) that sets the top-level
variable.
Bumps [chai](https://github.com/chaijs/chai) from 4.5.0 to 5.1.1.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](chaijs/chai@v4.5.0...v5.1.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
@wjt wjt force-pushed the dependabot/npm_and_yarn/chai-5.1.1 branch from 9a5a5e3 to c5f582d Compare September 30, 2024 19:18
@@ -7,14 +7,15 @@
// Upstream: https://github.com/mochajs/mocha/issues/185
process.env.NODE_ENV = 'test';

const chai = require('chai');
const expect = require('chai').expect;
import { expect } from 'chai';
Copy link
Member

Choose a reason for hiding this comment

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

I just saw https://evertpot.com/using-top-level-await-is-bc-break/ which refers to Node growing support for requireing an ES module in some cases. Which, if it works, would make this PR unnecessary.

Copy link
Contributor Author

dependabot bot commented on behalf of github Oct 28, 2024

A newer version of chai exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant