port js connection tests to mocha