Skip to content

Commit dbccc29

Browse files
committed
fix(unit-testing.md): unit-testing.md now uses MockMetadata from latest jest-mock
unit-testing.md referenced MockFunctionMetadata, which was removed in version 30 of jest-mock. This commit changes references of MockFunctionMetadata to MockMetadata, updating it to work with the newer versions of jest-mock.
1 parent 9822fae commit dbccc29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/fundamentals/unit-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Nest also allows you to define a mock factory to apply to all of your missing de
166166

167167
```typescript
168168
// ...
169-
import { ModuleMocker, MockFunctionMetadata } from 'jest-mock';
169+
import { ModuleMocker, MockMetadata } from 'jest-mock';
170170

171171
const moduleMocker = new ModuleMocker(global);
172172

@@ -185,7 +185,7 @@ describe('CatsController', () => {
185185
if (typeof token === 'function') {
186186
const mockMetadata = moduleMocker.getMetadata(
187187
token,
188-
) as MockFunctionMetadata<any, any>;
188+
) as MockMetadata<any, any>;
189189
const Mock = moduleMocker.generateFromMetadata(mockMetadata);
190190
return new Mock();
191191
}

0 commit comments

Comments
 (0)