Open TheJaredWilcurt opened 2 months ago
So some jackass already took the name I wanted, vue-snapshot-serializer
and of course it's just using shitty "prettier". God prettier is fucking awful. It's so bad. You couldn't have called your shitty, low-effort library "vue-snapshot-prettier"???? something accurate. Of course not. Beat me by 9 months.
great. That's what I get for putting this off for years.
Prettier is the Nickelback of formatting tools.
New repo and docs site mostly done.
Idea
Re-write this library mostly from the ground up (copying some stuff over as needed)
Reason
This repo is old, updating dependencies is no longer possible (requires ESM re-write). The repo's main priority is Vue 2 with Jest. Going forward we want the main priority to be Vue 3 with Vitest.
Plan
vitest-serializer-vue-tjw
- terrible namevue3-snapshot-serializer
- better namevue-snapshot-serializer
- yeah probably thatimport
require
package.json
,vue.config.js
,vite.config.js
, etc.)globalThis.vueSnapshots = {};
will be used for settings.global.beforeEach()
in their settings file.serializeVue(htmlOrVueWrapper, settings);
Planned API Support:
data-v-1234abcd=""
from your snapshotsdata-test="whatever"
from your snapshotsdata-testid="whatever"
from your snapshotsdata-test-id="whatever"
from your snapshotsdata-qa="whatever"
from your snapshotsdata-cy="whatever"
from your snapshots (Cypress)data-pw="whatever"
from your snapshots (Playwright)data-server-rendered="true"
from your snapshots['title', 'id']
produces<input title id class="stuff">
class="test-whatever"
id="test-whatever"
orid="testWhatever"
from snapshots/* istanbul ignore next */ cov_1lmjj6lxv1.f[3]++;
comments from snapshots. This may not be an issue in the new tech stack?<div title="(x) => !x">
becomes<div title="[function]">
<input>
becomes<input value="whatever">
. Not sure how to do this in Vue 3title="[object Object]"
withtitle="{a:'asdf'}"
. Not sure if this is possible in Vue 3New planned features
data-pw="whatever
)