Skip to content

Commit

Permalink
remove incorrect test
Browse files Browse the repository at this point in the history
  • Loading branch information
urugator committed Oct 29, 2023
1 parent 47beb21 commit 76806b2
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions packages/mobx-react/__tests__/observer.test.tsx
Expand Up @@ -296,27 +296,6 @@ test("issue 12", () => {
expect(events).toEqual(["table", "row: coffee", "row: tea", "table", "row: soup"])
})

test("changing state in render should fail", () => {
const data = observable.box(2)
const Comp = observer(() => {
if (data.get() === 3) {
try {
data.set(4) // wouldn't throw first time for lack of observers.. (could we tighten this?)
} catch (err) {
expect(err).toBeInstanceOf(Error)
expect(err).toMatch(
/Side effects like changing state are not allowed at this point/
)
}
}
return <div>{data.get()}</div>
})
render(<Comp />)

act(() => data.set(3))
_resetGlobalState()
})

test("observer component can be injected", () => {
const msg: Array<any> = []
const baseWarn = console.warn
Expand Down

0 comments on commit 76806b2

Please sign in to comment.