Skip to content

Commit

Permalink
test(lib): fix insert order race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunnamius committed Jul 1, 2022
1 parent 3d86d00 commit d3e762c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/next-auth/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ describe('::getOwnersEntries', () => {
token: { bearer: jest.requireActual('node:crypto').randomUUID() }
};

await expect(getOwnersEntries({ owners })).resolves.toStrictEqual([
await expect(getOwnersEntries({ owners })).resolves.toIncludeSameMembers([
toPublicAuthEntry(dummyRootData.auth[0]),
toPublicAuthEntry(dummyRootData.auth[1])
]);
Expand All @@ -870,7 +870,7 @@ describe('::getOwnersEntries', () => {
.collection<InternalAuthEntry>('auth')
.insertMany([newAuthEntry1, newAuthEntry2]);

await expect(getOwnersEntries({ owners })).resolves.toStrictEqual([
await expect(getOwnersEntries({ owners })).resolves.toIncludeSameMembers([
toPublicAuthEntry(dummyRootData.auth[0]),
toPublicAuthEntry(dummyRootData.auth[1]),
toPublicAuthEntry(newAuthEntry1),
Expand All @@ -879,7 +879,7 @@ describe('::getOwnersEntries', () => {

await expect(
getOwnersEntries({ owners: [...owners, undefined] })
).resolves.toStrictEqual([
).resolves.toIncludeSameMembers([
toPublicAuthEntry(dummyRootData.auth[0]),
toPublicAuthEntry(dummyRootData.auth[1]),
toPublicAuthEntry(newAuthEntry1),
Expand Down

1 comment on commit d3e762c

@vercel
Copy link

@vercel vercel bot commented on d3e762c Jul 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.