Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newest elm-test crashes with "You are giving module Main an argument in JavaScript." #62

Closed
jaapz opened this issue Aug 19, 2016 · 2 comments

Comments

@jaapz
Copy link

jaapz commented Aug 19, 2016

Using latest elm-test runner, the runner crashes with this error:

$ elm-test TestRunner.elm
Success! Compiled 1 module.
Successfully generated /tmp/elm_test_116719-15843-1kmv9mo.edvilcv7vi.js
undefined:1929
                        throw new Error(
                        ^

Error: You are giving module `Main` an argument in JavaScript.
This module does not take arguments though! You probably need to change the
initialization code to something like `Elm.Main.fullscreen()`
    at init (eval at <anonymous> (/usr/lib/node_modules/elm-test/bin/elm-test:86:37), <anonymous>:1929:10)
    at Object.eval [as callback] (eval at <anonymous> (/usr/lib/node_modules/elm-test/bin/elm-test:86:37), <anonymous>:1973:17)
    at step (eval at <anonymous> (/usr/lib/node_modules/elm-test/bin/elm-test:86:37), <anonymous>:2613:39)
    at Timeout.work [as _onTimeout] (eval at <anonymous> (/usr/lib/node_modules/elm-test/bin/elm-test:86:37), <anonymous>:2671:15)
    at tryOnTimeout (timers.js:232:11)
    at Timer.listOnTimeout (timers.js:202:5)

TestRunner.elm looks like this:

port module Main exposing (..)

import Test.Runner.Node exposing (run)
import Tests
import Json.Encode exposing (Value)


main : Program Never
main =
    run emit Tests.all


port emit : ( String, Value ) -> Cmd msg
$ elm --version
0.17.1

$ elm-test --version
0.17.3

$ node --version
v6.4.0
@rtfeldman
Copy link
Owner

@jaapz It's gotta be Program Value now, not Program Never.

Not sure how we can easily detect this, but that's the problem. 😄

@jaapz
Copy link
Author

jaapz commented Aug 19, 2016

Jep, that was the problem, thanks! Also, for anyone hitting this in the future, make sure to also upgrade rtfeldman/node-test-runner to 2.0.0 in your elm-package.json when you upgrade to the latest elm-test package on npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants