princejwesley / Mancy

>_ Electron based NodeJS REPL :see_no_evil:
http://mancy-re.pl
MIT License
2.63k stars 134 forks source link

can't run tests #116

Open hex13 opened 8 years ago

hex13 commented 8 years ago

Hello, I cloned repo, run npm install and npm run package, the I run npm test and what happened:


    > jest

    Using Jest CLI v0.5.10
     FAIL  components/__tests__/ReplEntryStatus-test.js (2.143s)
    ReplEntryStatus
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplConsoleMessageFilters-test.js (2.265s)
    ReplConsoleMessageFilters
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplOutputFunction-test.js (2.336s)
    ReplOutputFunction
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplStatusBar-test.js (2.409s)
    ReplStatusBar
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplEntryMessage-test.js 

     FAIL  components/__tests__/ReplEntry-test.js (1.029s)
    ReplEntry
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplEntryOutputError-test.js (0.937s)
    ReplEntryOutputError
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplOutputArray-test.js (0.944s)
    ReplOutputArray
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplEntryIcon-test.js (0.601s)
    ReplEntryIcon
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplOutputObject-test.js (0.88s)
    ReplOutputObject
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplPrompt-test.js (0.61s)
    ReplPrompt
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplActiveIcon-test.js (0.581s)
    ReplActiveIcon
      ✕ it encountered a declaration exception

     FAIL  components/__tests__/ReplConsole-test.js (1.16s)
    ReplConsole
      ✕ it encountered a declaration exception

    Running 1 test...

(and it's hanging on "running 1 test")

OS X 10.9.5 Used node version v4.4.0 (npm v2.14.20) but I tried some other versions too.

I suppose that problem could be related with: https://github.com/facebook/jest/issues/554 (although they write about npm3 but I used npm 2.14.20, like I wrote above, and it's not working)

I tried to debug via console.log when exactly is error and I learned that for example line let ReplPrompt = require('../ReplPrompt.js'); in specs: https://github.com/princejwesley/Mancy/blob/master/src/components/__tests__/ReplPrompt-test.js#L9 causes error:

[TypeError: /Users/lukasz/sandbox/Mancy/src/components/ReplPrompt.js: 
/Users/lukasz/sandbox/Mancy/node_modules/babel-runtime/helpers/possibleConstructorReturn.js: 
/Users/lukasz/sandbox/Mancy/node_modules/babel-runtime/helpers/typeof.js: 
/Users/lukasz/sandbox/Mancy/node_modules/babel-runtime/core-js/symbol.js: 
/Users/lukasz/sandbox/Mancy/node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/index.js: /Users/lukasz/sandbox/Mancy/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.symbol.js: Cannot read property 'type' of null]
princejwesley commented 8 years ago

@hex13 Yea. I should work on that area. It was working fine in version 1. I didn't write nor update the test cases. I'll spend time to fix and update here :smile:

hex13 commented 8 years ago

So on your installation you can't also running tests?

Because I wanted to add a feature. I made a preview feature for React elements: https://github.com/princejwesley/Mancy/pull/117 (no tests for now).

princejwesley commented 8 years ago

@hex13 Yea. No issues.

sibelius commented 8 years ago

@princejwesley you should consider using Snapshot testing available on jest 14 - https://facebook.github.io/jest/blog/2016/07/27/jest-14.html

it makes testing very simple