themarcba / nuxt-template

A practical starter template for Nuxt, which has Tailwind, FontAwesome, and Google fonts already built-in. Also, some common components are ready for use.
19 stars 1 forks source link

Feature: testing? #1

Open james2doyle opened 3 years ago

james2doyle commented 3 years ago

Nice template! Thanks for sharing. It would be cool to have snapshot testing support out-of-the-box.

Lots of people tend to use unit or end-to-end tests but for components, especially pages and layouts, I find snapshots much much better as they test the entire output of the component. So moving/changing a class, adding/removing attributes, or changing content, can be captured in a single line. Combine that with before and after snapshots for prop and data changes you can get a ton of coverage on your stuff.

What do you think? I can probably submit a PR for this if you're interested

themarcba commented 3 years ago

I know not much about snapshot testing. I would appreciate a PR 😊 I might learn something from it 👍

On Fri, May 14 2021 at 7:17 PM, James Doyle < @.*** > wrote:

Nice template! Thanks for sharing. It would be cool to have snapshot testing support out-of-the-box.

Lots of people tend to use unit or end-to-end tests but for components, especially pages and layouts, I find snapshots much much better as they test the entire output of the component. So moving/changing a class, adding/removing attributes, or changing content, can be captured in a single line. Combine that with before and after snapshots for prop and data changes you can get a ton of coverage on your stuff.

What do you think? I can probably submit a PR for this if you're interested

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub ( https://github.com/themarcba/nuxt-template/issues/1 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AALAYMYO4SR2YFTXZTH3JE3TNVLI5ANCNFSM444ZJBQA ).