Spec file for ECC/crypto
This commit is contained in:
parent
be14e77e01
commit
9a1532f4ee
1 changed files with 17 additions and 0 deletions
17
utils/ECC/crypto.spec.js
Normal file
17
utils/ECC/crypto.spec.js
Normal 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)
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
Add table
Add a link
Reference in a new issue