This commit is contained in:
QkoSad
2023-08-08 16:02:54 +03:00
commit 0a7a469d56
315 changed files with 426907 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
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/)
})
test('blog is being posted',async()=>{
await api.post('/api/blogs').send({title:'title2'})
const response = await api.get('api/blogs')
})
afterAll(async () => {
await mongoose.connection.close()
})