npm error ELIFECYCLE while running the test

前端 未结 4 1534
甜味超标
甜味超标 2020-12-15 18:33

I am using mocha-phantomjs setup for unit testing. I have following package.json scriot to run the tests.

\"scripts\": {
\"test\": \"npm run testFlickr\",
\"         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-15 18:34

    And when I run the command npm test in cmd, the test run alright

    No they aren't. You have 6 failing tests. The exit code of mocha-phantomjs is equal to the number of failing tests. Run mocha-phantomjs ./test/FlickrTest.html directly and see what is failing. Realize the PhantomJS is a bit different than your browser - you may have to debug it.

    Your script setup is odd. You should just have:

    "scripts": {
       "test": "mocha-phantomjs ./test/FlickrTest.html"
    }
    

    Then the odd node errors should go away.

提交回复
热议问题