jest-serializer-html
jest-serializer-html copied to clipboard
Replace/Filter dynamic values in attributes
Using v-for on inputs with labels generates can generate a random for
and matching id
. It would be cool if there was an option similar to the property matcher where you could define those.
I'm not sure if this is possible, as this simply stringifies the html directly, so there's no information whether something is an attribute. I would suggest mocking your randomiser to generate something predictable
oh well, the framework component gives the matching for/id pairs a generated uid I guess I cannot easily mock that
I guess worst case you could use createSerialiser and add a regex after? not sure how to solve this
That seems to be the way right now. regex for uuid and replace with a static value.
I guess what you could do is have some kind of override for https://github.com/algolia/diffable-html/blob/8911a117070d3e70ee5bf5674753c7ec0ccea436/index.js#L87