-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Allow custom serialisers #1861
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
Comments
The library underlying Writing such extensions is a fair bit more difficult than for Jest's snapshot mechanism, but I guess it won't get easier until we start encouraging people to write their own 😄 Question though, how do we want to configure these extensions? Programmatically? import {registerConcordancePlugin} from 'ava/extend' Or in the configuration file, with a factory method pattern? export default {
plugins: [
({registerConcordance}) => registerConcordance(…)
]
} We'll also need some metadata regarding the plugin that's been registered, so that if AVA encounters a snapshot without the corresponding plugin being available, it can give a useful error message. It's been a while since I've looked at the underlying code but these are the main questions I think. |
I'm tentatively adding this to the 4.0 milestone, but I reckon it won't make it. We're removing our built-in React support in AVA 4 so we'd want something like this to continue supporting React projects. See a stalled attempt in #2428. |
Basic API for augmenting the themes and appending plugins. Fixes #1861.
Err.. maybe it wasn't merged? 😔 |
Concordance needs a hefty dose of maintenance, though the extensibility APIs may not change much. So yea the issue is still open and this could be picked up by anybody but it's not currently a priority for me (insofar as a side-project can have priorities). |
Description
Currently if a HTML element is passed to
t.snapshot
it copies the code as is to the.md
file.I was hoping to pass a function to the serialiser so I could pretty print the content before it's saved to the
.md
file.Relevant Links
Example: app-header.spec.js.md
Example: html serialiser for Jest
Ref: https://twitter.com/novemberborn/status/1017718535274065920
The text was updated successfully, but these errors were encountered: