16 lines
350 B
JavaScript
16 lines
350 B
JavaScript
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()
|
|
}) |