Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/mobx-state-tree/test/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ test("snapshot should be available and updated during an action", t => {
const a = Model.create({ x: 2 })
t.is(a.inc(), 3)
t.is(a.x, 4)
t.is(getSnapshot(a).x, 4)
t.is((getSnapshot(a) as typeof Model).x, 4)
})

test("indirectly called private functions should be able to modify state", t => {
Expand Down
2 changes: 1 addition & 1 deletion packages/mobx-state-tree/test/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,5 @@ test("snapshot processors can be composed", t => {
}))
const x = X.create({ x: 25 })
t.is(x.x, 2)
t.is(getSnapshot(x).x, 25)
t.is((getSnapshot(x) as typeof X).x, 25)
})
6 changes: 3 additions & 3 deletions packages/mobx-state-tree/test/optimizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ test("it should avoid processing patch if is exactly the current one in reconcil
})
const store = RootModel.create({ a: { a: 1, b: "hello" } })
unprotect(store)
const snapshot = getSnapshot(store)
const snapshot = getSnapshot(store) as typeof Model
store.a = snapshot.a
t.is(getSnapshot(store.a), snapshot.a)
t.deepEqual(getSnapshot(store), snapshot)
t.is(getSnapshot(store.a) as typeof Model, snapshot.a)
t.deepEqual(getSnapshot(store) as typeof Model, snapshot)
})
2 changes: 1 addition & 1 deletion packages/mobx-state-tree/test/primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ test("Date can be rehydrated using unix timestamp", t => {
t.is(store.date.getTime(), time.getTime())
applySnapshot(store, { date: newTime })
t.is(store.date.getTime(), newTime)
t.is(getSnapshot(store).date, newTime)
t.is((getSnapshot(store) as typeof Factory).date, newTime)
})