-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Snapshot got 'Formatter buffer never received a formatted value' in v0.20 #1433
Comments
@zaaack would you able to share the test itself? Or perhaps find a reproducible test case? Snapshot assertions shouldn't fail without changes, so that's definitely odd. However the crash occurs when rendering the diff, so we don't know what the change was! I know what's going wrong, but I can't think of a situation where that would occur. So if you could share failing code that would be much appreciated. |
@novemberborn I think I find out why, it's caused by an undefined property changed to not undefined, or the opposite. Here is a minimal reproduce project: https://github.com/zaaack/ava-issue-1433/blob/master/src/Feedback.js#L38 |
Fix for avajs/ava#1433. The react plugin increases value indentation for properties. Combined with `maxDepth` this can lead to property values exceeding the max depth. The `maxDepth()` function is required on `SingleValueFormatter` so the property name is still included in the formatted output.
@zaaack thanks for the reproduction. I've got a fix in concordancejs/concordance#35. If you could install that version next to AVA it should get picked up. I'll try and get a release out soon. |
Fix for avajs/ava#1433. The react plugin increases value indentation for properties. Combined with `maxDepth` this can lead to property values exceeding the max depth. The `maxDepth()` function is required on `SingleValueFormatter` so the property name is still included in the formatted output.
It would fail in second time(compare). First time it success and output a snap file and a md file.
But this is totally OK in v0.18
1 passed 1 failed Root render /Users/z/Projects/Douban/share/helpcenter/helpcenter/static-source/feedback-popup/node_modules/concordance/lib/formatUtils.js:113 Rejected promise returned by test. Reason: Error { message: 'Formatter buffer never received a formatted value.', } SingleValueFormatter.finalize (node_modules/concordance/lib/formatUtils.js:113:31) Object.diffDescriptors (node_modules/concordance/lib/diff.js:379:27) _callee$ (test/root.test.js:41:11) tryCatch (node_modules/regenerator-runtime/runtime.js:65:40) Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:303:22) Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:117:21) Test.fn (test/root.test.js:39:1)
root.test.js.md
root.test.js.snap
root.test.js.snap.zip
The text was updated successfully, but these errors were encountered: