diff --git a/utils/ECC/crypto.spec.js b/utils/ECC/crypto.spec.js new file mode 100644 index 00000000..5e18abf7 --- /dev/null +++ b/utils/ECC/crypto.spec.js @@ -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) + }) +})