From 60669e6d12d02a712c70cf77a3eb0d807edf69f5 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Fri, 22 Apr 2022 18:48:52 +0100 Subject: [PATCH] fix: Delete _id off of expected results --- server/src/utils/user.test.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/server/src/utils/user.test.ts b/server/src/utils/user.test.ts index 46107bc4e..2986c774e 100644 --- a/server/src/utils/user.test.ts +++ b/server/src/utils/user.test.ts @@ -55,11 +55,15 @@ t.test("#GetUsersWithIDs", (t) => { t.test("Should return users with these IDs.", async (t) => { const res = await GetUsersWithIDs([2, 3]); - t.strictSame( - res, - [mkFakeUser(2), mkFakeUser(3)], - "Should return the user documents at these IDs." - ); + const expected = [mkFakeUser(2), mkFakeUser(3)]; + + for (const e of expected) { + // workaround for monk mutating our state. I know this is bad. + // I'll fix it at some point. + delete e._id; + } + + t.strictSame(res, expected, "Should return the user documents at these IDs."); t.end(); });