From 73646b6387e8133a343715bf74ca378ec3d89b5a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 13:24:25 +0200 Subject: [PATCH] fix!: update dependency chai to v5 (#5135) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Vladimir Sheremet --- packages/expect/package.json | 2 +- packages/expect/src/jest-extend.ts | 8 +-- packages/vitest/package.json | 2 +- pnpm-lock.yaml | 70 +++++++++++-------- .../tests/__snapshots__/html.test.ts.snap | 1 + 5 files changed, 49 insertions(+), 34 deletions(-) diff --git a/packages/expect/package.json b/packages/expect/package.json index f712b10e53e3..d2a5cfea10dd 100644 --- a/packages/expect/package.json +++ b/packages/expect/package.json @@ -36,7 +36,7 @@ "dependencies": { "@vitest/spy": "workspace:*", "@vitest/utils": "workspace:*", - "chai": "^4.3.10" + "chai": "^5.0.3" }, "devDependencies": { "@types/chai": "4.3.6", diff --git a/packages/expect/src/jest-extend.ts b/packages/expect/src/jest-extend.ts index 27c53f843e71..bbe27df36ddd 100644 --- a/packages/expect/src/jest-extend.ts +++ b/packages/expect/src/jest-extend.ts @@ -1,4 +1,4 @@ -import { util } from 'chai' +import { use, util } from 'chai' import type { ChaiPlugin, ExpectStatic, @@ -55,8 +55,8 @@ class JestExtendError extends Error { } } -function JestExtendPlugin(expect: ExpectStatic, matchers: MatchersObject): ChaiPlugin { - return (c, utils) => { +function JestExtendPlugin(c: Chai.ChaiStatic, expect: ExpectStatic, matchers: MatchersObject): ChaiPlugin { + return (_, utils) => { Object.entries(matchers).forEach(([expectAssertionName, expectAssertion]) => { function expectWrapper(this: Chai.AssertionStatic & Chai.Assertion, ...args: any[]) { const { state, isNot, obj } = getMatcherState(this, expect) @@ -139,6 +139,6 @@ function JestExtendPlugin(expect: ExpectStatic, matchers: MatchersObject): ChaiP export const JestExtend: ChaiPlugin = (chai, utils) => { utils.addMethod(chai.expect, 'extend', (expect: ExpectStatic, expects: MatchersObject) => { - chai.use(JestExtendPlugin(expect, expects)) + use(JestExtendPlugin(chai, expect, expects)) }) } diff --git a/packages/vitest/package.json b/packages/vitest/package.json index e2a7924b667d..2af428bd6eff 100644 --- a/packages/vitest/package.json +++ b/packages/vitest/package.json @@ -152,7 +152,7 @@ "@vitest/snapshot": "workspace:*", "@vitest/spy": "workspace:*", "@vitest/utils": "workspace:*", - "chai": "^4.3.10", + "chai": "^5.1.0", "debug": "^4.3.4", "execa": "^8.0.1", "magic-string": "^0.30.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 56a9f2b207a0..13bc6e06b69a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -634,8 +634,8 @@ importers: specifier: workspace:* version: link:../utils chai: - specifier: ^4.3.10 - version: 4.3.10 + specifier: ^5.0.3 + version: 5.0.3 devDependencies: '@types/chai': specifier: 4.3.6 @@ -876,8 +876,8 @@ importers: specifier: workspace:* version: link:../utils chai: - specifier: ^4.3.10 - version: 4.3.10 + specifier: ^5.1.0 + version: 5.1.0 debug: specifier: ^4.3.4 version: 4.3.4(supports-color@8.1.1) @@ -7375,6 +7375,12 @@ packages: /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + dev: true + + /assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + dev: false /ast-types@0.13.4: resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==} @@ -7806,17 +7812,26 @@ packages: type-detect: 1.0.0 dev: true - /chai@4.3.10: - resolution: {integrity: sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==} - engines: {node: '>=4'} + /chai@5.0.3: + resolution: {integrity: sha512-wKGCtYv2kVY5WEjKqQ3fSIZWtTFveZCtzinhTZbx3/trVkxefiwovhpU9kRVCwxvKKCEjTWXPdM1/T7zPoDgow==} + engines: {node: '>=12'} dependencies: - assertion-error: 1.1.0 - check-error: 1.0.3 - deep-eql: 4.1.3 - get-func-name: 2.0.2 - loupe: 2.3.6 - pathval: 1.1.1 - type-detect: 4.0.8 + assertion-error: 2.0.1 + check-error: 2.0.0 + deep-eql: 5.0.1 + loupe: 3.1.0 + pathval: 2.0.0 + dev: false + + /chai@5.1.0: + resolution: {integrity: sha512-kDZ7MZyM6Q1DhR9jy7dalKohXQ2yrlXkk59CR52aRKxJrobmlBNqnFQxX9xOX8w+4mz8SYlKJa/7D7ddltFXCw==} + engines: {node: '>=12'} + dependencies: + assertion-error: 2.0.1 + check-error: 2.0.0 + deep-eql: 5.0.1 + loupe: 3.1.0 + pathval: 2.0.0 dev: false /chainsaw@0.1.0: @@ -7880,10 +7895,9 @@ packages: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} dev: true - /check-error@1.0.3: - resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} - dependencies: - get-func-name: 2.0.2 + /check-error@2.0.0: + resolution: {integrity: sha512-tjLAOBHKVxtPoHe/SA7kNOMvhCRdCJ3vETdeY0RuAc9popf+hyaSV6ZEg9hr4cpWF7jmo/JSWEnLDrnijS9Tog==} + engines: {node: '>= 16'} dev: false /check-more-types@2.24.0: @@ -8640,11 +8654,9 @@ packages: type-detect: 0.1.1 dev: true - /deep-eql@4.1.3: - resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} + /deep-eql@5.0.1: + resolution: {integrity: sha512-nwQCf6ne2gez3o1MxWifqkciwt0zhl0LO1/UwVu4uMBuPmflWM4oQ70XMqHqnBJA+nhzncaqL9HVL6KkHJ28lw==} engines: {node: '>=6'} - dependencies: - type-detect: 4.0.8 dev: false /deep-equal@2.2.1: @@ -12071,14 +12083,14 @@ packages: dependencies: js-tokens: 4.0.0 - /loupe@2.3.6: - resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} + /loupe@2.3.7: + resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} dependencies: get-func-name: 2.0.2 dev: false - /loupe@2.3.7: - resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + /loupe@3.1.0: + resolution: {integrity: sha512-qKl+FrLXUhFuHUoDJG7f8P8gEMHq9NFS0c6ghXG1J0rldmZFQZoNVv/vyirE9qwCIhWZDsvEFd1sbFu3GvRQFg==} dependencies: get-func-name: 2.0.2 dev: false @@ -13268,8 +13280,9 @@ packages: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} dev: true - /pathval@1.1.1: - resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + /pathval@2.0.0: + resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} + engines: {node: '>= 14.16'} dev: false /pend@1.2.0: @@ -15451,6 +15464,7 @@ packages: /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} + dev: true /type-fest@0.16.0: resolution: {integrity: sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==} diff --git a/test/reporters/tests/__snapshots__/html.test.ts.snap b/test/reporters/tests/__snapshots__/html.test.ts.snap index 8f765c937cfe..58d0059bfcb5 100644 --- a/test/reporters/tests/__snapshots__/html.test.ts.snap +++ b/test/reporters/tests/__snapshots__/html.test.ts.snap @@ -55,6 +55,7 @@ exports[`html reporter > resolves to "failing" status for test file "json-fail" "message": "expected 2 to deeply equal 1", "name": "AssertionError", "nameStr": "AssertionError", + "ok": false, "operator": "strictEqual", "showDiff": true, "stack": "AssertionError: expected 2 to deeply equal 1",