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

After switch to concordance, diff on large objects sometimes does not show #3560

Closed
6 tasks done
ldiqual opened this issue Jun 12, 2023 · 0 comments · Fixed by #3582
Closed
6 tasks done

After switch to concordance, diff on large objects sometimes does not show #3560

ldiqual opened this issue Jun 12, 2023 · 0 comments · Fixed by #3582

Comments

@ldiqual
Copy link

ldiqual commented Jun 12, 2023

Describe the bug

The following test fails as expected, but doesn't print the diff between actual & expected: https://gist.github.com/ldiqual/f874381a2e836fc57ca8c07be9f2f397
I believe this is due to https://github.com/vitest-dev/vitest/blob/main/packages/utils/src/diff.ts#L27-L28 which expects a specific color from the concordance output. However it sounds like concordance sometimes prints a 31m red plus, instead of a 32m green plus.

After inserting a bunch of console logs in @vitest/utils/diff.js, this is the raw output from concordance and the plus/minus that vitest expects:

Line:
"  +   contractSumToDatePreTax: 90909"

Raw:
"  \u001b[31m+\u001b[39m   contractSumToDatePreTax: \u001b[33m90909\u001b[39m\u001b[90m,\u001b[39m"

Plus:
"  \u001b[32m-\u001b[39m "

Minus:
"  \u001b[32m+\u001b[39m"

Reproduction

Run the following test: https://gist.github.com/ldiqual/f874381a2e836fc57ca8c07be9f2f397

System Info

System:
    OS: macOS 13.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 111.31 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/Library/Caches/fnm_multishells/27761_1686604561032/bin/node
    Yarn: 3.6.0 - ~/Library/Caches/fnm_multishells/27761_1686604561032/bin/yarn
    npm: 9.5.1 - ~/Library/Caches/fnm_multishells/27761_1686604561032/bin/npm
  Browsers:
    Chrome: 114.0.5735.106
    Firefox: 109.0
    Safari: 16.5
  npmPackages:
    @vitejs/plugin-react-swc: 3.3.2 => 3.3.2
    vite: 4.3.9 => 4.3.9
    vitest: 0.32.0 => 0.32.0

Used Package Manager

yarn

Validations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant