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
Inline Snapshot won't be written into the source code #2327
Comments
I have multiple updates behind me and with those packages it still doesn't work: "@vitejs/plugin-react": "^4.0.1",
"@vitest/coverage-c8": "^0.32.2",
"@vitest/ui": "^0.32.2", Normal snapshots, which get written into external files work but inline snapshots doesn't get written into the test file. At the same time Vitest does know if an inline snapshot has changed or not and correctly it throws an error if it did. |
@kwiat1990 I encountered the same issue. Did you find any workarounds? |
I added a try/catch around
I'm using the browser mode, not sure if it's related. My vitest version is 0.33.0. |
I didn’t. In some files it does work, in others not. It found it pretty odd and it’s normal snapshots, which save output into a file. |
I got the error above when using Update: The error was from a package called
|
I'm experiencing the same issue with and without
node v21.5.0 |
Cannot reproduce the bug mentioned in the description of this issue anymore. Please, if you have a similar bug, open another issue with reproduction. |
Describe the bug
After update to Vitest
0.25.1
inline snapshot don't get written in the source code as usual, so thatexpect(container).toMatchInlineSnapshot();
stay always empty. At the same time, in case the under the hood generated snapshot has changed, Vitest will output an error in the console with both expected and received content.Reproduction
Install Vitest
0.25.1
and try to generate an inline snapshot for this component:vitest.config.ts
:System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: