Update index.js

Reconnect when test fails