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

Function testClone

test/unit/requests-test.js:307–322  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

305});
306
307function testClone(request) {
308 it('should return a new instance with the same properties', function () {
309 const cloned = request.clone();
310 assert.notStrictEqual(request, cloned);
311 Object.keys(request).forEach(function (key) {
312 assert.strictEqual(request[key], cloned[key]);
313 });
314 });
315 it('should generate the same buffer', function () {
316 const cloned = request.clone();
317 assert.strictEqual(
318 request.write(encoder, 1).toString(),
319 cloned.write(encoder, 1).toString()
320 );
321 });
322}
323
324function testRequestLength(requestGetter) {
325 it('should set the length of the body of the request', () => {

Callers 1

requests-test.jsFile · 0.85

Calls 5

forEachMethod · 0.65
keysMethod · 0.65
toStringMethod · 0.65
cloneMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected