tests fail or hang randomly on travis with PhantomJS

566 views Asked by At

I run my tests with testem and PhantomJS, they all pass on my local machine, but when i run them on travis, they fail randomly, or hang, It's not like some specific tests fail, some pass, randomsome fail, I have no idea what's going on. My project is available on github https://github.com/eguneys/marbles-site

Edit:

I've optimized it a little, it fixed the hang issue, now the problem is it fails the first integration test. I added an App.reset() before the first integration test. And it passes now. I had trouble with App.reset() before,

Erik Bryn suggested that you can use App.reset() in the setup method rather than teardown so you can see the application's last state. But that causes tests to fail, i can't solve the mystery of App.reset() and fear the tests will fail anytime now. Yet they pass at the moment.

1

There are 1 answers

0
Iman  Mohamadi On

Go to your package.json file and change scripts.test like this:

"test": "testem ci --launch node,PhantomJS"

I'm not sure what's the reason of your tests failing, but If it's with the integration, this should help.