node-ejs-renderer/node_modules/hyperdyperid/lib/__tests__/randomU32.spec.js

11 lines
331 B
JavaScript
Raw Normal View History

2024-06-09 13:55:01 -04:00
const {randomU32} = require('../randomU32');
test('works', () => {
for (let i = 0; i < 1000; i++) {
const min = Math.round(Math.random() * 0xFFFFFF);
const max = min + Math.round(Math.random() * 0xFFFFFF);
const num = randomU32(min, max);
expect(num >= min && num <= max).toBe(true);
}
});