getRoot in afterAttach returns undefined in Jest tests
Author: garrettg123Created Jul 14, 2020Updated Aug 18, 2025
Labelshas PR
Bug report
- I've checked documentation and searched for existing issues
- I've made sure my project is based on the latest MST version
- Fork this code sandbox or another minimal reproduction.
Sandbox link or minimal reproduction code https://codesandbox.io/s/mobx-state-tree-todolist-wvupz?file=/index.test.js
Describe the expected behavior
getRoot(self) should be defined in afterAttach
Describe the observed behavior It is undefined
Source: mobxjs/mobx-state-tree