tjw-lint / vue3-snapshot-serializer

Vitest/Jest Snapshot Serializer for Vue 3 components
https://TheJaredWilcurt.com/vue-snapshot-serializer
MIT License
3 stars 2 forks source link

Use global settings in formatter #32

Closed TheJaredWilcurt closed 2 weeks ago

TheJaredWilcurt commented 2 weeks ago

I originally thought I'd use the formatter function directly, or externalize it or something, so it currently takes in an options object and does type checking on the options.

For simplicity, it makes more sense to treat it like the rest of the code in this codebase and have it grab the options off the globalThis.vueSnapshot.formatting object. Which by that point would have gone through the "loadOptions" function which is already doing the type checking once (no need to do it in two places).