This repository has been archived on 2025-12-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
fullstack-open/part4/bloglist/tests/blog_api.test.js
Andrew Trieu 31436ad7fa Upload 4.8
2023-05-31 15:20:53 +03:00

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()
})