-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
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.0Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable