Upload 4.8
This commit is contained in:
16
part4/bloglist/tests/blog_api.test.js
Normal file
16
part4/bloglist/tests/blog_api.test.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const mongoose = require('mongoose')
|
||||
const supertest = require('supertest')
|
||||
const app = require('../app')
|
||||
|
||||
const api = supertest(app)
|
||||
|
||||
test('blogs are returned as json', async () => {
|
||||
await api
|
||||
.get('/api/blogs')
|
||||
.expect(200)
|
||||
.expect('Content-Type', /application\/json/)
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
await mongoose.connection.close()
|
||||
})
|
||||
Reference in New Issue
Block a user