Guest User

Untitled

a guest
Jan 26th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import randomString from 'random-string'
  2. import {
  3. uuid
  4. } from '../../utils/uuid'
  5. import {
  6. models
  7. } from '../../models'
  8.  
  9. afterAll(() => models.sequelize.close())
  10.  
  11. test('ordered UUID 가 출력되어야 합니다.', () => {
  12. const orderedUuid = uuid()
  13.  
  14. expect(orderedUuid)
  15. .toMatch(/\b4[0-9A-Fa-f]{31}\b/g)
  16. })
  17.  
  18. test('사용자를 생성하면 uuid 가 정상 생성되어야 합니다', async () => {
  19. const user = await models.User.create({
  20. email: `${randomString()}@test.com`,
  21. password: randomString()
  22. })
  23.  
  24. expect(user.uuid)
  25. .toMatch(/\b4[0-9A-Fa-f]{31}\b/g)
  26. })
Add Comment
Please, Sign In to add comment