SHARE
TWEET

Untitled

a guest Jan 26th, 2019 135 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top