From 9a1532f4ee1a91a991b9c67073c9fec65193804e Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Sun, 12 Dec 2021 11:29:03 -0400 Subject: [PATCH] Spec file for ECC/crypto --- utils/ECC/crypto.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 utils/ECC/crypto.spec.js 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) + }) +})