Skip to content

Commit b254655

Browse files
committed
fix: re-add message
1 parent 5c4fe85 commit b254655

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { expect } from "vitest";
22

3-
export function toIncludeSameMembers<T>(actual: T[], expected: T[]): { pass: boolean } {
3+
export function toIncludeSameMembers<T>(actual: T[], expected: T[]): { pass: boolean; message: () => string } {
44
expect(actual).toEqual(expect.arrayContaining(expected as unknown[]));
55
expect(expected).toEqual(expect.arrayContaining(actual as unknown[]));
66

77
return {
88
pass: true,
9+
message: () =>
10+
`Expected arrays to include the same members.\nExpected: ${JSON.stringify(expected)}\nReceived: ${JSON.stringify(actual)}`,
911
};
1012
}

0 commit comments

Comments
 (0)