mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Merge pull request #28694 from g-plane/fix-jest
[jest] add missing matcher
This commit is contained in:
Vendored
+8
@@ -481,6 +481,10 @@ declare namespace jest {
|
||||
* If you know how to test something, `.not` lets you test its opposite.
|
||||
*/
|
||||
not: Matchers<R>;
|
||||
/**
|
||||
* Ensure that a mock function is called with specific arguments on an Nth call.
|
||||
*/
|
||||
nthCalledWith(nthCall: number, ...params: any[]): R;
|
||||
/**
|
||||
* Ensure that the nth call to a mock function has returned a specified value.
|
||||
*/
|
||||
@@ -504,6 +508,10 @@ declare namespace jest {
|
||||
* Ensures that a mock function is called.
|
||||
*/
|
||||
toBeCalled(): R;
|
||||
/**
|
||||
* Ensures that a mock function is called an exact number of times.
|
||||
*/
|
||||
toBeCalledTimes(expected: number): R;
|
||||
/**
|
||||
* Ensure that a mock function is called with specific arguments.
|
||||
*/
|
||||
|
||||
@@ -504,6 +504,9 @@ describe("", () => {
|
||||
expect(jest.fn()).lastReturnedWith("jest");
|
||||
expect(jest.fn()).lastReturnedWith({});
|
||||
|
||||
expect(jest.fn()).nthCalledWith(0, "jest");
|
||||
expect(jest.fn()).nthCalledWith(1, {});
|
||||
|
||||
expect(jest.fn()).nthReturnedWith(0, "jest");
|
||||
expect(jest.fn()).nthReturnedWith(1, {});
|
||||
|
||||
@@ -513,6 +516,8 @@ describe("", () => {
|
||||
|
||||
expect(jest.fn()).toBeCalled();
|
||||
|
||||
expect(jest.fn()).toBeCalledTimes(1);
|
||||
|
||||
expect(jest.fn()).toBeCalledWith();
|
||||
expect(jest.fn()).toBeCalledWith("jest");
|
||||
expect(jest.fn()).toBeCalledWith({}, {});
|
||||
|
||||
Reference in New Issue
Block a user