diff --git a/README.md b/README.md
index 084cd50..a778703 100644
--- a/README.md
+++ b/README.md
@@ -129,3 +129,100 @@ declare global {
}
}
```
+
+## Matchers
+
+### Asymmetric Matchers
+
+
+
+Name | Description | Example |
+
+
+
+
+`toBeCalledWithContext`/`toHaveBeenCalledWithContext`
+
+ |
+
+
+Assert a function has been called with a specific context (`this`).
+
+ |
+
+
+```ts
+expect(mock).toBeCalledWithContext(expectedContext);
+expect(mock).toHaveBeenCalledWithContext(expectedContext);
+```
+
+ |
+
+
+
+
+`lastCalledWithContext`/`toHaveBeenLastCalledWithContext`
+
+ |
+
+
+Assert the last call of a function was with a specific context (`this`).
+
+ |
+
+
+```ts
+expect(mock).lastCalledWithContext(expectedContext);
+expect(mock).toHaveBeenLastCalledWithContext(expectedContext);
+```
+
+ |
+
+
+
+
+`nthCalledWithContext`/`toHaveBeenNthCalledWithContext`
+
+ |
+
+
+Assert the Nth call of a function was with a specific context (`this`).
+
+ |
+
+
+```ts
+expect(mock).lastCalledWithContext(expectedContext);
+expect(mock).toHaveBeenLastCalledWithContext(expectedContext);
+```
+
+ |
+
+
diff --git a/src/asymmetricMatchers/exactly.ts b/src/asymmetricMatchers/exactly.ts
index ee8f86c..6f36411 100644
--- a/src/asymmetricMatchers/exactly.ts
+++ b/src/asymmetricMatchers/exactly.ts
@@ -2,6 +2,19 @@ import type { MatcherFunction } from "expect";
import type { MatcherHintOptions } from "jest-matcher-utils";
import type { AsymmetricMatcher } from "../utils/types";
+/**
+ * Matches against the provided value using `Object.is`.
+ * You can use it inside "deep equal" matchers like `toBeCalledWith` to ensure that only the correct reference will be allowed.
+ * @example
+ * const fn = jest.fn();
+ * const ref = {};
+ *
+ * fn(ref);
+ *
+ * expect(fn).toBeCalledWith({})
+ * expect(fn).not.toBeCalledWith(expect.exactly({}))
+ * expect(fn).toBeCalledWith(expect.exactly(ref))
+ */
export const exactly: MatcherFunction<[expected: unknown]> = function (
received,
expected,
@@ -38,6 +51,19 @@ export const exactly: MatcherFunction<[expected: unknown]> = function (
declare module "./index" {
export interface AsymmetricMixNMatchers {
+ /**
+ * Matches against the provided value using `Object.is`.
+ * You can use it inside "deep equal" matchers like `toBeCalledWith` to ensure that only the correct reference will be allowed.
+ * @example
+ * const fn = jest.fn();
+ * const ref = {};
+ *
+ * fn(ref);
+ *
+ * expect(fn).toBeCalledWith({})
+ * expect(fn).not.toBeCalledWith(expect.exactly({}))
+ * expect(fn).toBeCalledWith(expect.exactly(ref))
+ */
exactly