Skip to content

Commit

Permalink
Update testHelper.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Nov 15, 2024
1 parent caf20b0 commit 12a12b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/tests/testHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as settingController from '../src/controllers/settingController'

export const getName = (prefix: string) => {
expect(prefix.length).toBeGreaterThan(1)
return `${prefix}.${nanoid()}`.toLowerCase()
return `${prefix}.${nanoid()}.${Date.now()}`.toLowerCase()
}

export const getRandomString = () => getName(Date.now().toString())
Expand Down Expand Up @@ -109,7 +109,7 @@ export const signinAsAdmin = () => signin(wexcommerceTypes.AppType.Backend, ADMI

export const signinAsUser = () => signin(wexcommerceTypes.AppType.Frontend, USER_EMAIL)

export const GetRandomEmail = () => `random.${nanoid()}.${Date.now()}@test.wexcommerce.ma`
export const GetRandomEmail = () => `${getName('random')}@test.wexcommerce.com`

export const GetRandromObjectId = () => new mongoose.Types.ObjectId()

Expand Down

0 comments on commit 12a12b3

Please sign in to comment.