Skip to content

Commit 76806b2

Browse files
committed
remove incorrect test
1 parent 47beb21 commit 76806b2

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

packages/mobx-react/__tests__/observer.test.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -296,27 +296,6 @@ test("issue 12", () => {
296296
expect(events).toEqual(["table", "row: coffee", "row: tea", "table", "row: soup"])
297297
})
298298

299-
test("changing state in render should fail", () => {
300-
const data = observable.box(2)
301-
const Comp = observer(() => {
302-
if (data.get() === 3) {
303-
try {
304-
data.set(4) // wouldn't throw first time for lack of observers.. (could we tighten this?)
305-
} catch (err) {
306-
expect(err).toBeInstanceOf(Error)
307-
expect(err).toMatch(
308-
/Side effects like changing state are not allowed at this point/
309-
)
310-
}
311-
}
312-
return <div>{data.get()}</div>
313-
})
314-
render(<Comp />)
315-
316-
act(() => data.set(3))
317-
_resetGlobalState()
318-
})
319-
320299
test("observer component can be injected", () => {
321300
const msg: Array<any> = []
322301
const baseWarn = console.warn

0 commit comments

Comments
 (0)