Help with writing unit tests - asMutable() is not a function

234
0
09-27-2023 08:30 AM
AdamPigg
New Contributor II

Hi

Im trying to get my head around writing unit tests for me Experience Builder widgets using Jest.

Im finding the Ersi docs/example quite limited, there are only 2 widgets in the samples folder with tests!

Anyway, My first hickup is, in my widget code, the config is an immutable object, and it gets copied using config.asMutable() ... jest complains that asMutable() is not a function.  How should I work around this?

I have other cases such as using the SessionManager, do I need to mock these?

Thanks for any tips

Adam

0 Kudos
0 Replies