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
As you can see jest captured it as a string. Furthermore, as far I know Jest is only a testing framework that allows you to capture snapshots right in the code.
I really do love testing via inline snapshots. Most of the time I need to add tests for existing code (and speaking more generally I didn't get used to do TDD). Anyway, writing .toEqual by hand is not an option for me.
Jest GUIs (such as majestic) and its alternatives (such as Ava) support only snapshots as separate files (Jest's toMatchSnapshot). I don't like this as I need to jump around .snap files.
[3:29 PM]
Again, I love inline snapshots as I can see the result right in the code. In case if they are bloated I can just collapse all toMatchInlineSnapshot calls in IDE.
And finally what I want from testing library after running test command:
I understand that this might be tricky to implement, however I didn't see any focus on snapshot testing from anybody, which is extremely frustrating for me.
Hope I gave you enough context for the idea, feel free to ping me if something isn't clear.
[3:30 PM]
Now I got the idea for codemod to transform .toMatchInlineSnapshot to .toEqual but I would lose the ability to update failing snapshots from UI in this case.
January 17, 2022
The text was updated successfully, but these errors were encountered:
From discord: https://discord.com/channels/712696926406967308/931174951229206618/931525305896689694
This is what works with Jest today:
After running jest becomes:
As you can see jest captured it as a string. Furthermore, as far I know Jest is only a testing framework that allows you to capture snapshots right in the code.
I really do love testing via inline snapshots. Most of the time I need to add tests for existing code (and speaking more generally I didn't get used to do TDD). Anyway, writing .toEqual by hand is not an option for me.
Jest GUIs (such as majestic) and its alternatives (such as Ava) support only snapshots as separate files (Jest's toMatchSnapshot). I don't like this as I need to jump around .snap files.
[3:29 PM]
Again, I love inline snapshots as I can see the result right in the code. In case if they are bloated I can just collapse all toMatchInlineSnapshot calls in IDE.
And finally what I want from testing library after running test command:
I understand that this might be tricky to implement, however I didn't see any focus on snapshot testing from anybody, which is extremely frustrating for me.
Here is an example where I use a lot of .toMatchInlineSnapshot: https://github.com/zardoy/vscode-framework/blob/next/packages/vscode-framework/test/cli/manifestGenerators.test.ts.
Hope I gave you enough context for the idea, feel free to ping me if something isn't clear.
[3:30 PM]
Now I got the idea for codemod to transform .toMatchInlineSnapshot to .toEqual but I would lose the ability to update failing snapshots from UI in this case.
January 17, 2022
The text was updated successfully, but these errors were encountered: