Comments (4)
I'd be happy to accept a PR for it!
Looks like it'd need to use child_process.execFileSync
and temp.openSync
instead of temp.open
.
from node-elm-compiler.
@rtfeldman Alright, I've PR'd the new helper, however it looks like my assumptions were wrong on what the result would be. I'm now successfully compiling my Elm to JS, but it looks like the Elm component doesn't get properly "rendered" using Jest and Enzyme. This might not be the best place to ask, but any advice on how to get a simple Elm app to render out its text? I've got a basic static component:
port module Welcome exposing (main)
import Html exposing (div, p, text)
main : Program Never (Never -> a) Never
main =
Html.beginnerProgram { model = never, view = view, update = never }
view : never -> Html.Html msg
view never =
div []
[ p [] [ text "Welcome!!!" ]
, p [] [ text "the bananas are over there" ]
]
And I'm using an updated version of react-elm-components
. Against that component, I'm just expecting the text "Welcome!!!"
to be in the rendered component.
from node-elm-compiler.
@mockdeep I don't quite follow the question, but if you're trying to do stuff with Html then you need to use elm-static-html-lib or elm-html-test.
from node-elm-compiler.
@eeue56 thanks for the information. To clarify a bit, I've mounted an Elm app inside of a React component, which works for me when I boot up my server and navigate to the page (I see the "Welcome!!!" text). However, I have tests written in JavaScript using the Jest testing framework and Enzyme for rendering the React components.
What I'm trying to accomplish is to have a way to gradually convert the React to Elm while minimally changing the tests. Adding this renderToStringSync
compiler gets me a step closer, but it looks like there's still something that triggers Elm to render into the page when I visit it in the browser which doesn't get triggered in the tests. Not sure if it's the right direction, but one thought is maybe whether I could pluck the Elm app out of the components in the test and render it to static html using your elm-static-html-lib
, but not too sure.
from node-elm-compiler.
Related Issues (20)
- Errors on Windows with paths containing spaces
- Add ENOENT handling for nonexistent CWD
- parcel : node-elm-compiler : ENOENT when elm installed localy (vs globably) HOT 1
- Support multiple main files... take 2 HOT 1
- Elm 0.18 HOT 1
- warn: true blew up HOT 1
- Support `--docs` flag HOT 4
- Add a way to retrieve the warnings from Elm Compiler HOT 1
- node-elm-compiler.findAllDependencies ignores imports after "{- -}"-comment HOT 1
- process.exit(1) makes it hard to use node-elm-compiler via require()
- pathToMake and elm 0.19 HOT 1
- Passing a non-existing pathToElm does not properly throw
- TypeScript HOT 2
- Remove stale branches HOT 1
- Flaky build HOT 2
- Color output for errors? HOT 4
- node-elm-compiler depending on vulnerable package (lodash) HOT 2
- Version 5.0.2 missing index.js HOT 6
- lodash's vulnerabilities strike again HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-elm-compiler.