-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.test.js
51 lines (40 loc) · 1.22 KB
/
user.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// const sum = require('./sum')
// const { registerController } = require('./controllers/auth.controller')
// test('add 1+2 to equal 3', () => {
// expect(sum(1, 2)).toBe(3)
// })
// test('there is no I in team', () => {
// expect('team').not.toMatch(/I/)
// })
// test('but there is a "stop" in Christoph', () => {
// expect('Christoph').toMatch(/stop/)
// })
// test('Return Token', async () => {
// const data = await registerController(req = {
// body: {
// name: 'Code',
// email: '[email protected]',
// password: '123qwe'
// }
// })
// expect(data).toBeTruth()
// })
const request = require('supertest')
// const { getDB } = require('./database.js')
// const db = getDB()
const app = require('./server')
// const User = db.collection('User')
// const { db,client } = require('./db/database')
// afterAll(done => {
// // Closing the DB connection allows Jest to exit successfully.
// client.close()
// db.close()
// done()
// })
// jest.setTimeout(50000)
test('Should signup a new user', async () => {
const response = await request(app).post('/register')
.send({ name: 'Test', email: '[email protected]', password: '123qwe' })
.expect(200)
// console.log(response.body)
})