You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing a failed snapshot, but the vite reporter doesn't report more than a couple of lines of the snapshot diff, so I'm unable to tell what the test failed on.
The too-terse console output looks like this in github...
However, in retrospect I think this could be my non-conformant use of toMatchInlineSnapshot().
The expanded snapshot string version was overwhelmed with whitespace making it impossible to read, so I switched it to a javascript array, which seemed functional until it failed only in github (with no good feedback from the snapshot error). The tests were passing when run locally.
But maybe this was never meant to work. To align with expectations, perhaps I should have switched the signature of toMatchInlineSnapshot() to be toEqual() after refactoring the snapshot from a string to an array.
Until this point I found the pattern of switching the snapshot string to be an array to be fine in practice, but this may be why the error serialization is wrong - if it (maybe correctly) makes a strong assumption that snapshot is a string not an array. Feel free to close if Javascript objects/arrays are non-conformant snapshots.
System Info
npx envinfo --system --npmPackages '{vitest,@vitest/*,vite,@vitejs/*}' --binaries --browsers
Need to install the following packages:
envinfo@7.11.0
Ok to proceed? (y) y
System:
OS: macOS 13.5
CPU: (10) arm64 Apple M1 Pro
Memory: 83.50 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.9.0 - /opt/homebrew/opt/nvm/versions/node/v20.9.0/bin/node
Yarn: 1.22.19 - ~/.asdf/shims/yarn
npm: 10.1.0 - /opt/homebrew/opt/nvm/versions/node/v20.9.0/bin/npm
pnpm: 8.6.11 - /opt/homebrew/opt/nvm/versions/node/v20.3.1/bin/pnpm
Browsers:
Chrome: 119.0.6045.199
Edge: 119.0.2151.97
Safari: 16.6
### Used Package Manager
npm
### Validations
- [X] Follow our [Code of Conduct](https://github.com/vitest-dev/vitest/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitest.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/vitest-dev/vitest/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitest-dev/vitest/discussions) or join our [Discord Chat Server](https://chat.vitest.dev).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
The text was updated successfully, but these errors were encountered:
Describe the bug
As per #3201 ( @sheremet-va suggested I report a new bug ) ...
I am experiencing a failed snapshot, but the vite reporter doesn't report more than a couple of lines of the snapshot diff, so I'm unable to tell what the test failed on.
Reproduction
The issue was observed in the Gitlab actions run at https://github.com/cefn/watchable/actions/runs/7088197269/job/19290116297?pr=55 and originates from the test suite source at https://github.com/cefn/watchable/blob/32630d4bb29e6ad3c6f1fa29b613b47ad2913b24/packages/nevermore/test/strategies/concurrency.test.ts#L50-L63
The too-terse console output looks like this in github...
However, in retrospect I think this could be my non-conformant use of
toMatchInlineSnapshot()
.The expanded snapshot string version was overwhelmed with whitespace making it impossible to read, so I switched it to a javascript array, which seemed functional until it failed only in github (with no good feedback from the snapshot error). The tests were passing when run locally.
But maybe this was never meant to work. To align with expectations, perhaps I should have switched the signature of
toMatchInlineSnapshot()
to betoEqual()
after refactoring the snapshot from a string to an array.Until this point I found the pattern of switching the snapshot string to be an array to be fine in practice, but this may be why the error serialization is wrong - if it (maybe correctly) makes a strong assumption that snapshot is a string not an array. Feel free to close if Javascript objects/arrays are non-conformant snapshots.
System Info
The text was updated successfully, but these errors were encountered: