DEV Community

loading...

Discussion on: Testing Node.js + Mongoose with an in-memory database

Collapse
astonyao profile image
Aston Yao

awesome. thanks for sharing this.

I'd also check

const savedProduct = await productService.create(productComplete)
expect(savedProduct._id).toBeDefined()
expect(savedProduct.name).toBe(productComplete.name)