ddanielsantos / astro-deck

mvp mdx-deck clone
6 stars 0 forks source link

how to test #22

Open ddanielsantos opened 1 year ago

ddanielsantos commented 1 year ago

Lib

Built-in components

Navigation

ddanielsantos commented 1 year ago

Maybe cypress isn't the way to go

We can test more easily by unit testing the lib functions and using react-testing-library in the built-in components

ddanielsantos commented 1 year ago

But without Cypress we can't test navigation, the final testing setup can be a mix of those 3 strategies

ddanielsantos commented 1 year ago

react-testing-lib works for built-in components, but it isn't the right tool for Astro components.

the Astro team is planning some API to render components individually, this can lead to a proper tool for Astro component testing.

the only place that astro-deck actually needs to test a Astro component is the slide-wrapper layout, but its implementation isn't stable right now and may change to a react component (because we need to support slide gestures)

ddanielsantos commented 1 year ago

now, we also need to test the CLI, integration tests would be cool

ddanielsantos commented 1 year ago

https://www.smashingmagazine.com/2022/04/testing-cli-way-people-use-it/

ddanielsantos commented 1 year ago

basic config for CLI testing added at #68