-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
It looks like the latest Jest v30 types are incompatible with MobX.
"@types/jest": "~30.0.0""jest": "~30.1.3""mobx": "~6.13.7"
Here's some sample code that will cause a type error:
const initial = new ObservableSet<string>(["foo", "bar"])
const updated = new ObservableSet<string>(initial)With the new @types/jest version, we get this type error:
error TS2345: Argument of type 'ObservableSet<string>' is not assignable to parameter of type 'IObservableSetInitialValues<string> | undefined'.
Type 'ObservableSet<string>' is not assignable to type 'Set<string>'.
The types returned by 'entries()' are incompatible between these types.
Property '[Symbol.dispose]' is missing in type 'IterableIterator<[string, string]>' but required in type 'SetIterator<[string, string]>'.
If I downgrade to "@types/jest": "~29.5.14", the problem goes away.
I'm not entirely sure this is a mobx problem, but it does seem to only be happening on mobx values from the spot checking I've done so far.