Spec file for ECC/crypto

This commit is contained in:
Daniel Lugo 2021-12-12 11:29:03 -04:00
parent be14e77e01
commit 9a1532f4ee

17
utils/ECC/crypto.spec.js Normal file
View file

@ -0,0 +1,17 @@
/**
* @format
*/
// @ts-check
const expect = require('expect')
const { generateRandomString } = require('./crypto')
describe('generateRandomString()', () => {
it('creates a random string of the specified length', async () => {
expect.hasAssertions()
const len = Math.ceil(Math.random() * 100)
const result = await generateRandomString(len)
expect(result.length).toEqual(len)
})
})