Monaca Onsen UI Discord Chat Github Repo

Testing React Onsen Apps



  • I’ve been doing tons of research online to see if anyone has gotten jest+enzyme working in an onsen+react context. So far I haven’t found any articles with the magic bullet as of July 2018. I’m still experiencing the “Invalid State” error on importing onsenui or finding window.document to be undefined.

    Has anyone gotten this working either using undom as Fran recommends below or another solution?

    Re: How are you testing React Onsen Apps?

    I attempted the recommendation in this SO thread as well and that didn’t make window.document available to reoct-onsenui when it was imported either at this point:

    SO: react onsenui mocha test error “Error: Invalid state”

    I would be grateful to hear any recommendations / experiences of others. Thanks!