Skip to content

Commit 73646b6

Browse files
renovate[bot]sheremet-va
andauthoredMay 9, 2024··
fix!: update dependency chai to v5 (#5135)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
1 parent a99a14c commit 73646b6

File tree

5 files changed

+49
-34
lines changed

5 files changed

+49
-34
lines changed
 

‎packages/expect/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"dependencies": {
3737
"@vitest/spy": "workspace:*",
3838
"@vitest/utils": "workspace:*",
39-
"chai": "^4.3.10"
39+
"chai": "^5.0.3"
4040
},
4141
"devDependencies": {
4242
"@types/chai": "4.3.6",

‎packages/expect/src/jest-extend.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { util } from 'chai'
1+
import { use, util } from 'chai'
22
import type {
33
ChaiPlugin,
44
ExpectStatic,
@@ -55,8 +55,8 @@ class JestExtendError extends Error {
5555
}
5656
}
5757

58-
function JestExtendPlugin(expect: ExpectStatic, matchers: MatchersObject): ChaiPlugin {
59-
return (c, utils) => {
58+
function JestExtendPlugin(c: Chai.ChaiStatic, expect: ExpectStatic, matchers: MatchersObject): ChaiPlugin {
59+
return (_, utils) => {
6060
Object.entries(matchers).forEach(([expectAssertionName, expectAssertion]) => {
6161
function expectWrapper(this: Chai.AssertionStatic & Chai.Assertion, ...args: any[]) {
6262
const { state, isNot, obj } = getMatcherState(this, expect)
@@ -139,6 +139,6 @@ function JestExtendPlugin(expect: ExpectStatic, matchers: MatchersObject): ChaiP
139139

140140
export const JestExtend: ChaiPlugin = (chai, utils) => {
141141
utils.addMethod(chai.expect, 'extend', (expect: ExpectStatic, expects: MatchersObject) => {
142-
chai.use(JestExtendPlugin(expect, expects))
142+
use(JestExtendPlugin(chai, expect, expects))
143143
})
144144
}

‎packages/vitest/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"@vitest/snapshot": "workspace:*",
153153
"@vitest/spy": "workspace:*",
154154
"@vitest/utils": "workspace:*",
155-
"chai": "^4.3.10",
155+
"chai": "^5.1.0",
156156
"debug": "^4.3.4",
157157
"execa": "^8.0.1",
158158
"magic-string": "^0.30.5",

‎pnpm-lock.yaml

+42-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎test/reporters/tests/__snapshots__/html.test.ts.snap

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ exports[`html reporter > resolves to "failing" status for test file "json-fail"
5555
"message": "expected 2 to deeply equal 1",
5656
"name": "AssertionError",
5757
"nameStr": "AssertionError",
58+
"ok": false,
5859
"operator": "strictEqual",
5960
"showDiff": true,
6061
"stack": "AssertionError: expected 2 to deeply equal 1",

0 commit comments

Comments
 (0)
Please sign in to comment.