mattpocock / xstate-codegen

A codegen tool for 100% TS type-safety in XState
MIT License
245 stars 12 forks source link

Rebuilt test suite to only test public api #24

Closed mattpocock closed 4 years ago

mattpocock commented 4 years ago

This PR removes all unit tests from the project and replaces them with a much simpler, more comprehensive test suite.

The test suite now runs the actual codegen tool on the 'examples' folder, and typechecks them. This means:

  1. Issues can now be added to our integration tests by adding failing machines to our 'examples' folder. Once this PR is merged I'll add cases for #23 and #21. This is far easier and more transparent than contributing to unit tests.
  2. Big changes to internals can be made (such as the upcoming migration away from rollup to pure TS) without any changes to the test suite.
  3. No more having to run yarn local-link to test local repositories - just copy them and their imported files to the 'examples' folder and run yarn test:watch.
changeset-bot[bot] commented 4 years ago

💥 No Changeset

Latest commit: 5c003667e8db1aa427b2a777a696f9d62b870763

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

mattpocock commented 4 years ago

@Andarist agree on all the above. We have a rather lovely situation in that we get to do e2e testing without any of the usual downsides - slow tests and flakiness. This should cover the vast majority of our bases while also providing a really nice local dev environment for contributors.