You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a small template project with Mobx 4.2 / Typescript which works fine, including testing store with Jest.
I updated Mobx dependency to 5.0.0-beta.6 and the code seems to work otherwise fine but testing the store gives an error "TypeError: allKeys[x].match is not a function". The row which fails just tests TypeScript Array equality to [].
Output when running 'yarn' and then 'yarn test':
FAIL src/stores/app/index.test.ts
● AppStore › addCounterNote should add new note to notes array beginning
TypeError: allKeys[x].match is not a function
6 |
7 | expect(store.counter).toEqual(0)
> 8 | expect(store.notes).toEqual([])
9 | store.addCounterNote()
10 | expect(store.counter).toEqual(1)
11 | expect(store.notes.length).toEqual(1)
at Object.<anonymous> (src/stores/app/index.test.ts:8:25)
I'm not sure if this is a Mobx problem but the fact that same works with Mobx 4.2 implies that the problem could atleast be a compatibility issue which should be documented somewhere in v5 docs.
The text was updated successfully, but these errors were encountered:
I have a small template project with Mobx 4.2 / Typescript which works fine, including testing store with Jest.
I updated Mobx dependency to 5.0.0-beta.6 and the code seems to work otherwise fine but testing the store gives an error "TypeError: allKeys[x].match is not a function". The row which fails just tests TypeScript Array equality to [].
Output when running 'yarn' and then 'yarn test':
FAIL src/stores/app/index.test.ts
● AppStore › addCounterNote should add new note to notes array beginning
A repository which reproduces the problem can be found at https://github.com/tkivela/react-ts-mobx-template-v5jestproblem
I'm not sure if this is a Mobx problem but the fact that same works with Mobx 4.2 implies that the problem could atleast be a compatibility issue which should be documented somewhere in v5 docs.
The text was updated successfully, but these errors were encountered: