Next.js Discord

Discord Forum

Jest + RTL, problem with testing segments useSelectedLayoutSegments()

Unanswered
Yellowstripe scad posted this in #help-forum
Open in Discord
Yellowstripe scadOP
Hello, I've got problem with Jest RTL testing my Next project.
I'm getting this error while trying to test Breadcrumbs component which uses useSelectedLayoutSegments()
function.
TypeError: Cannot destructure property 'tree' of '(0 , _react.useContext)(...)' as it is null.

I've tried to google it but I didnt found anything specific.
Anyone had similalr issue or knows what can be a problem?

0 Replies