Better test
This commit is contained in:
parent
e9ccbeab20
commit
6a5b6af31f
1 changed files with 2 additions and 1 deletions
|
|
@ -13,7 +13,8 @@ const {
|
||||||
describe('generateRandomString()', () => {
|
describe('generateRandomString()', () => {
|
||||||
it('creates a random string of the specified length', async () => {
|
it('creates a random string of the specified length', async () => {
|
||||||
expect.hasAssertions()
|
expect.hasAssertions()
|
||||||
const len = Math.ceil(Math.random() * 100)
|
const base = Math.ceil(Math.random() * 100)
|
||||||
|
const len = base % 2 !== 0 ? base + 1 : base
|
||||||
const result = await generateRandomString(len)
|
const result = await generateRandomString(len)
|
||||||
|
|
||||||
expect(result.length).toEqual(len)
|
expect(result.length).toEqual(len)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue