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

Function assertTimeUuidFunction

test/unit/uuid-tests.js:246–265  ·  view source on GitHub ↗
(portions, callback)

Source from the content-addressed store, hash-verified

244 const clockId = 'zz';
245
246 function assertTimeUuidFunction(portions, callback) {
247 return (function assertTimeUuid(err, id) {
248 assert.ifError(err);
249 helper.assertInstanceOf(id, TimeUuid);
250 assert.strictEqual(id.getDate().getTime(), date.getTime());
251
252 if (portions > 1) {
253 assert.strictEqual(id.getDatePrecision().ticks, ticks);
254 }
255
256 if (portions > 2) {
257 assert.strictEqual(id.getNodeId().toString(), nodeId);
258 }
259
260 if (portions > 3) {
261 assert.strictEqual(id.getClockId().toString().slice(1), clockId.slice(1));
262 }
263 callback();
264 });
265 }
266
267 it('should support callback as second parameter', done =>
268 TimeUuid.fromDate(date, assertTimeUuidFunction(1, done)));

Callers 1

uuid-tests.jsFile · 0.85

Calls 2

toStringMethod · 0.65
sliceMethod · 0.45

Tested by

no test coverage detected