cva icon indicating copy to clipboard operation
cva copied to clipboard

Add Tests for README Examples

Open joe-bell opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. It's all well and good recommending uses for cva but it would be reassuring to know these examples actually work 🥴 e.g. for React, Vue and Svelte.

Describe the solution you'd like Expanding existing tests

Additional context I did set out to include tests, but got put off by the amount of setup needed to run tests for some libraries in Jest with TypeScript. Would love to have this resolved 🙏

joe-bell avatar Feb 01 '22 12:02 joe-bell

I understand why you might want to stick to Jest, but I'd like to put forward a suggestion of using Vitest.

It has a Jest-like API, TypeScript support out-of-the-box, and you can use Vite plugins with it, so popular libraries are covered. From my experience I think it would be easier to set up.

At a minimum you can probably just add plugins for React, Vue, and Svelte to Vitest config and then it should be able to transform .jsx, .tsx, .vue, and .svelte files.

brattonross avatar Mar 23 '22 23:03 brattonross

Cheers @brattonross, I'll take a look when I find a moment 🙏

joe-bell avatar Mar 27 '22 19:03 joe-bell