I’m using mongodb for js driver 3.1.6 and I can’t pass the unit test user-management.test.js.
It seems the db.collection.insertOne(doc) will add a new _id field to doc. So the following in test file won’t hold any more.
delete user["_id"] expect(user).toEqual(testUser)
You should do something like this to get around this:
delete user["_id"] delete testUser["_id"] expect(user).toEqual(testUser)
In fact, there are some other unit tests I can’t pass, but I can pass the tickets.