I am making jest tests for my project and I want to verify that the unique identifier of the blog posts is named id.
This is my mongoose db blog posts collection:
[
{
title: 'Breaking Ice',
author: 'Mike Vasovsky',
url: 'www.mikey.com',
likes: 14,
id: '5fe21b5931f6ae09d4cc58b6'
}
]
My not finished part of the code:
test("verify id property name", async () => {
const response = await api
.get('/api/blogs')
expect(...).toBeDefined("id")
})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…