Replies: 5 comments
-
You might need to use await act(async () => {
// render JSX here
})
expect(renderer.scene.children.length).toBe(2) |
Beta Was this translation helpful? Give feedback.
-
still the same issue
|
Beta Was this translation helpful? Give feedback.
-
any update on this or resolution? i'm running into the same problem attempting to use |
Beta Was this translation helpful? Give feedback.
-
I have unable to get children when using useTexture do. Have you solved the issue? |
Beta Was this translation helpful? Give feedback.
-
It looks like the issue might be that the animated mesh isn’t fully rendered when the test runs. Since useSpring adds animations, the scene might not update instantly. You could try adding a longer wait time or ensuring the animation has fully settled before making assertions. |
Beta Was this translation helpful? Give feedback.
-
Hello All,
below is my unit test file
// ignore the missing import of the component
and my component looks like
the component functions as expected but I am trying to write simple unit tests and the
renderer.scene.children is always an array of 0.
Also, i believe I need "wait" for the spring to do its job and hence using waitFor.
can someone point me to the right direction ?
PS: the application itself is super simple @react-three/fiber app i.e it is not super customized.
Beta Was this translation helpful? Give feedback.
All reactions