mitosis icon indicating copy to clipboard operation
mitosis copied to clipboard

E2E coverage

Open kylecordes opened this issue 3 years ago • 2 comments

Currently

E2E covers just two cases

  • single-component-with-state
  • two components, one using the other

Goal

Add more cases, to gradually cover all Mitosis features. Thus the E2E tests would measure (and eventually verify) Mitosis feature/target coverage.

kylecordes avatar Aug 01 '22 17:08 kylecordes

What if we added a test suite that did something akin to:

  • Generate X framework component from Mitosis
  • Ran TestingLibrary (or similar) over the compiled output of X to verify its functionality

That way, we knew that the X framework compiled output actually did something in relation to the expected functionality?

crutchcorn avatar May 07 '23 04:05 crutchcorn

We already do this with:

  • snapshots: in packages/core/src/__tests__/test-generator.ts, we generate snapshots for every output
  • e2e tests: in e2e/e2e-app/src, we run e2e tests for every output

Adding a testing library to test rendering would require more code generation and problem-solving that I don't think is worth the pain. We should primarily focus on adding more e2e tests, as that's the best way to make sure we test functionality across the board.

samijaber avatar May 10 '23 18:05 samijaber