MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / testConnect

Function testConnect

test/integration/short/client-pool-tests.js:456–470  ·  view source on GitHub ↗
(contactPoint, testDone)

Source from the content-addressed store, hash-verified

454 }
455 ], done);
456 function testConnect(contactPoint, testDone) {
457 const client = newInstance({ contactPoints: [ contactPoint ] });
458 client.connect(function (err) {
459 assert.ifError(err);
460 assert.strictEqual(client.hosts.length, 1);
461 let expected = contactPoint + ':9042';
462 if (contactPoint.indexOf('[') === 0) {
463 expected = contactPoint.replace(/[[\]]/g, '');
464 }
465 assert.strictEqual(client.hosts.values()[0].address, expected);
466 utils.times(10, function (n, next) {
467 client.execute(helper.queries.basic, next);
468 }, helper.finish(client, testDone));
469 });
470 }
471 });
472 });
473

Callers 1

Calls 4

connectMethod · 0.80
newInstanceFunction · 0.70
valuesMethod · 0.65
executeMethod · 0.45

Tested by

no test coverage detected