Commit 0ba2fb68 authored by Simon Breiter's avatar Simon Breiter
Browse files

fix: wip

parent ddd7a349
Pipeline #394188082 passed with stages
in 3 minutes and 35 seconds
......@@ -9,9 +9,9 @@ describe('basic db operations', () => {
connection = await initializeDatabases()
})
// afterAll(async () => {
// await connection.close()
// })
afterAll(async () => {
await connection.close()
})
beforeEach(async () => {
db = await connection.db('test')
......
......@@ -41,7 +41,7 @@ function createUsersRoute (dbConnection) {
})
.delete(async (req, res) => {
try {
const user = await users.remove({
const user = await users.deleteOne({
_id: new ObjectId(req.params.userId)
})
res.send({
......
......@@ -10,9 +10,9 @@ beforeAll(async () => {
dbConnection = server.dbConnection
})
// afterAll(async () => {
// await dbConnection.close()
// })
afterAll(async () => {
await dbConnection.close()
})
beforeEach(() => {
db = dbConnection.db('test')
......@@ -153,6 +153,15 @@ test('Delete a single user', done => {
expect(response.body).toEqual({
message: 'Deleted user.'
})
return cb(null, userId)
}),
userId =>
request(app)
.get(`/users/${userId}`)
.set('Accept', 'application/json')
.expect(200)
.then(response => {
expect(response.body).toEqual({})
done()
})
])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment