MCPcopy
hub / github.com/pmndrs/react-spring / expectUpdates

Function expectUpdates

packages/core/src/SpringContext.test.tsx:35–46  ·  view source on GitHub ↗
(updates: any[])

Source from the content-addressed store, hash-verified

33 )
34
35 const expectUpdates = (updates: any[]) => {
36 onProps.mock.calls.forEach((args, i) => {
37 const update = updates[i]
38 if (update) {
39 expect(args[0]).toMatchObject(update)
40 } else {
41 // Unexpected update.
42 expect(args[0]).toBeUndefined()
43 }
44 })
45 onProps.mockClear()
46 }
47
48 const elem = await render(getRoot())
49 // React.StrictMode runs the layout effect twice on initial mount

Callers 1

Calls 1

forEachMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…