Skip to content

Commit

Permalink
fix(docs) fixing error in example of jest.mocked (#12174)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rajat19 committed Dec 22, 2021
1 parent 2bc72c6 commit 523fa7e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/JestObjectAPI.md
Expand Up @@ -618,7 +618,7 @@ test('deep', () => {
test('direct', () => {
foo.name();
// here only foo.name is mocked (or its methods if it's an object)
expect(mocked(foo.name).mock.calls).toHaveLength(1);
expect(jest.mocked(foo.name).mock.calls).toHaveLength(1);
});
```

Expand Down
1 change: 0 additions & 1 deletion packages/jest-mock/src/index.ts
Expand Up @@ -92,7 +92,6 @@ export type MockedClass<T extends Constructable> = MockInstance<
> & {
prototype: T extends {prototype: any} ? Mocked<T['prototype']> : never;
} & T;

export interface Constructable {
new (...args: Array<any>): any;
}
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-27.4/JestObjectAPI.md
Expand Up @@ -618,7 +618,7 @@ test('deep', () => {
test('direct', () => {
foo.name();
// here only foo.name is mocked (or its methods if it's an object)
expect(mocked(foo.name).mock.calls).toHaveLength(1);
expect(jest.mocked(foo.name).mock.calls).toHaveLength(1);
});
```

Expand Down

0 comments on commit 523fa7e

Please sign in to comment.