mobxjs / mobx-state-tree

Full-featured reactive state management without the boilerplate
https://mobx-state-tree.js.org/
MIT License
6.94k stars 640 forks source link

Test/add more test coverage for types model #2044

Closed coolsoftwaretyler closed 1 year ago

coolsoftwaretyler commented 1 year ago

I wrote this PR mostly to learn more about MobX-State-Tree internals - it adds some additional tests around types.model.

I personally learned a lot doing this, and I think the test coverage will be good! My intention is to keep doing things like this over the course of the next six months. Should accomplish two goals:

  1. Get me more familiar with the library
  2. The more test coverage we have about specific behaviors, the clearer it will be to us when PRs "break" the API. In an ideal state, we'd have appropriate tests to exercise the entire API surface, so that a passing test suite ensures us a changeset isn't breaking, and a failing test suite indicates we may have broken the API contract.

I also added the draft to a blog post. I intend to publish that on my blog, but I wanted to include it in this PR for now to get some early feedback on it. I added it as a standalone commit, so we can rebase and drop it pretty easily.

coolsoftwaretyler commented 1 year ago

Blog post here: https://coolsoftware.dev/blog/what-happens-when-you-create-an-mst-model/