darul75 / web-react

:diamond_shape_with_a_dot_inside: Another React Dev Kit with Webpack and NodeJS
https://react-web.herokuapp.com/
81 stars 8 forks source link

Tests #8

Closed ktmn closed 9 years ago

ktmn commented 9 years ago

Quick question about tests

C:\Users\User\Documents\Apps\web-react (master)
λ npm run test

> web-react@1.0.6 test C:\Users\User\Documents\Apps\web-react
> mocha app/**/*-test.js --colors --compilers js:babel/register --recursive

  Todo-item component
    1) "before all" hook: render and locate element

  0 passing (67ms)
  1 failing

  1) Todo-item component "before all" hook: render and locate element:
     Error: Cannot find module 'jsdom'
      at Object.<anonymous> (C:/Users/User/Documents/Apps/web-react/conf/tests/setup.js:1:13)
      at Context.<anonymous> (C:/Users/User/Documents/Apps/web-react/app/components/TodoSection/__tests__/TodoItem-test.js:15:4)

I did try to install them globally

npm i mocha -g
npm i jsdom -g

but still got that error. Then I tried to install it locally

npm i jsdom --save

and now it's giving this error:

  1) Todo-item component "before all" hook: render and locate element:
     C:\Users\User\Documents\Apps\web-react\node_modules\jsdom\lib\jsdom.js:3
`jsdom 4.x onward only works on io.js, not Node.js™: https://github.com/tmpvar
^

Is it wrong jsdom or something?

darul75 commented 9 years ago

Have you run npm install first ? I remember jsdom new version are not compliant with node, check for and old one. Or remove node_modules folder and run npm install Again

darul75 commented 9 years ago

currently doing some changes on master branch, be careful to use released one

ktmn commented 9 years ago

I ran npm install, it installed the "jsdom": "^5.5.0" version

If I remove version 5.5.0, change it to ^2.0.0 and run install again it starts throwing errors about me not having python installed. So now I need that too?

ktmn commented 9 years ago

Installed Python 2.7 and Visual Studio Express 2013 (1.2gb, that's quite the dependancy!) and changed both jsdom versions in the package.json to 3.0.0, ran npm install and tests now work.

darul75 commented 9 years ago

Sorry busy repairing car this morning ;) nice work I remember having installed all this stuff, nice work dude