WIP: Use Mongoose object._id in place of object.id so we can use POJO
Use Mongoose object._id
in place of object.id
so we can use POJO JSON objects with the fixture users. Because of the nature of this change, it also just fixes up a lot of places we weren't using mongoUtils.objectIDsEqual
Part of https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1480
modules/test-utils/lib/create-users.js
+ .then(async function() {
+ const user = await User.create(doc);
+ // We convert to a plain object so when we add properties like accessToken below,
+ // so it properly serializes in our `/api/private/seed` endpoint
+ return user.toJSON();
+ });
POJO: Plain-old JavaScript object
lean, json
Edited by Eric Eastwood