Skip to content

Commit 2c6a15d

Browse files
committed
Changed to using testUtils.getRandomInt
1 parent 086e750 commit 2c6a15d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/DB.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ describe(DB.name, () => {
328328
const dbPath = `${dataDir}/db`;
329329
const db = await DB.createDB({ dbPath, crypto, logger });
330330
const keys: Array<Buffer> = Array.from({ length: 100 }, () =>
331-
nodeCrypto.randomBytes(Math.ceil(Math.random() * 100)),
331+
nodeCrypto.randomBytes(testUtils.getRandomInt(0, 101)),
332332
);
333333
for (const k of keys) {
334334
await db.put(k, 'value');
@@ -393,8 +393,10 @@ describe(DB.name, () => {
393393
const dbPath = `${dataDir}/db`;
394394
const db = await DB.createDB({ dbPath, crypto, logger });
395395
const keys: Array<Array<Buffer>> = Array.from({ length: 100 }, () =>
396-
Array.from({ length: Math.ceil(Math.random() * 10) }, () =>
397-
nodeCrypto.randomBytes(Math.ceil(Math.random() * 10)),
396+
Array.from({ length: testUtils.getRandomInt(0, 11) }, () =>
397+
nodeCrypto.randomBytes(
398+
testUtils.getRandomInt(0, 11)
399+
),
398400
),
399401
);
400402
for (const k of keys) {

0 commit comments

Comments
 (0)