Open EnriqueVidal opened 7 years ago
@EnriqueVidal Did you ever figure out a solution? I suspect it has something to do with the use of shouldComponentUpdate
in index.js, but I don't know enough about React to be sure.
@ethagnawl I didn't and had to move on, so nowadays I separate my Elm and react into separate projects. I hadn't closed this in hopes that someone may have found a work around I will try again as soon as I can and either close this issue and post said workaround or update my findings.
@EnriqueVidal It seems like this isn't possible. As far as I can tell, the only way to achieve any sort of pre-rendering of an Elm application is to actually spin up a (headless) browser, wait for the page to load and the app to initialize (wait until an element/id present in your Elm app makes an appearance?), scrape the page and then dump the page's contents to a file.
Sorry for the long wait since it's a work week I haven been able to look into this yet, however my test suite runs on either HeadlessChrome
or JSDOM
I'd be happy if it were possible in any, will definitely try it. Thanks for the info.
I know I can test Elm files with elm-test, but I'm also trying to run a small end to end test for my react file with the Elm component, the problem however is that the
<Elm />
component inreact-elm-components
always renders an empty<div />
in mocha.Any ideas on how to do an end to end test of a react component that's also rendering an Elm file?
Thanks in advance.