deadfoxygrandpa / elm-test

A unit testing framework for Elm
MIT License
204 stars 21 forks source link

Crash: TypeError: Cannot read property 'make' of undefined #24

Open akeeton opened 9 years ago

akeeton commented 9 years ago

(Moved from https://github.com/rtfeldman/node-elm-test/issues/3)

I have a simple test in my project that crashes node-elm-test. To reproduce, do

git clone https://github.com/akeeton/nickel-havana.git
cd nickel-havana
git reset --hard f62db33
cd test
elm-test src/TestMyList.elm

The output I get is

Compiling src/TestMyList.elm
Some new packages are needed. Here is the upgrade plan.

  Install:
    deadfoxygrandpa/Elm-Test 1.0.4
    elm-lang/core 2.1.0
    maxsnew/IO 1.0.1

Do you approve of this plan? (y/n) 
y
Downloading deadfoxygrandpa/Elm-Test
Downloading elm-lang/core
Downloading maxsnew/IO
Packages configured successfully!
Success! Compiled 41 modules.
Successfully generated /tmp/elm_test_11571-14917-b21vna

Successfully compiled src/TestMyList.elm
Running tests...
Cannot read property 'make' of undefined
[stdin]:8147
                throw error;
                      ^
TypeError: Cannot read property 'make' of undefined
    at init ([stdin]:8134:20)
    at Object.Elm.worker ([stdin]:8032:11)
    at [stdin]:11615:22
    at [stdin]:11653:3
    at Object.exports.runInThisContext (vm.js:74:17)
    at Object.<anonymous> ([stdin]-wrapper:6:22)
    at Module._compile (module.js:460:26)
    at evalScript (node.js:431:25)
    at Socket.<anonymous> (node.js:164:11)
    at Socket.emit (events.js:129:20)

As a control, I have added your example test.

elm-test src/NodeTestExampleTest.elm

It works as expected:

Compiling src/NodeTestExampleTest.elm
Success! Compiled 1 modules.
Successfully generated /tmp/elm_test_11571-15007-1a36lod

Successfully compiled src/NodeTestExampleTest.elm
Running tests...
  1 suites run, containing 3 tests
  0 suites and 2 tests passed
  1 suites and 1 tests failed

Test Suite: A Test Suite: FAILED
  Addition: passed.
  String.left: passed.
  This test should fail: FAILED. not True
deadfoxygrandpa commented 8 years ago

Can you try this again with the new node-elm-test version 0.16.0-beta? Or wait until @rtfeldman releases it publicly.