nathanboktae / mocha-phantomjs

:coffee: :ghost: Run client-side mocha tests in the command line through phantomjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

phantomjs terminated with signal SIGSEGV

WNLee opened this issue · comments

When I run "mocha-phantomjs -R dot /test/file.html",it catch "phantomjs terminated with signal SIGSEGV". What caused this error?

Same issue for me, running mocha-phantomjs on an ElCapitan OSX:

> mocha-phantomjs ./test/client/index.html

phantomjs terminated with signal SIGKILL
npm ERR! Test failed.  See above for more details.

mocha-phantomjs is just a thin CLI around phantomjs. If it's being killed you'll need to figure it out with phantomjs. However I see you already asked @WNLee (ariya/phantomjs#13702) and got blown off. I'd try running simple phantomjs examples and seeing if they work. If your on OS X, sometimes there can be issues with decompressing the binary, so you can use upx directly - see ariya/phantomjs#12900

If you need to use phantomjs 2, you can use mocha-phantomjs-core directly.

upx -d phantomjs can fix my problem. Phantomjs can run on my OS X 10.10.5.

I had the same issue on MacOS Sierra. The solution was to tell mocha-phantomjs to use my local (homebrew installed) phantomjs using the -p option.

/path/to/mocha-phantomjs -p /usr/local/bin/phantomjs ...

@WNLee How did upx -d phantomjs fix the problem? What is it supposed to do?

@jackocnr can you expand on that, have the two paths, where do I put them?

@evamedia you just add that -p option whenever you run mocha-phantomjs. For me that was in package.json, under "scripts".

@jackocnr Your solution works for me, but does the extra -p parameter hurt developers who don't have the phantomjs file in that path?

This issue is closed, which indicates it would be fixed in mocha-phantomjs, but I still need to do the workaround.

macOS 10.12.4
phantomjs 2.1.1 (via HomeBrew)
$ npm list | grep mocha
├─┬ mocha@3.2.0
├─┬ mocha-phantomjs@4.1.0
│ ├── mocha-phantomjs-core@1.3.1

Yes that solution would require all devs to have phantomjs installed in the same path. TBH we ended up switching from mocha-phantomjs to mocha-phantomjs-core which solved the issue for us.