Skip to content

Commit 4fc8e24

Browse files
committed
fix: 🐛 mock.ts SpyObject type
Type 'R' does not satisfy the constraint 'FunctionLike'.ts(2344) This type parameter might need an `extends FunctionLike` constraint.
1 parent b96db66 commit 4fc8e24

File tree

1 file changed

+2
-1
lines changed
  • projects/spectator/jest/src/lib

1 file changed

+2
-1
lines changed

projects/spectator/jest/src/lib/mock.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { FactoryProvider, AbstractType, Type } from '@angular/core';
44
import { installProtoMethods, CompatibleSpy, SpyObject as BaseSpyObject } from '@ngneat/spectator';
55
import { jest } from '@jest/globals';
66

7-
export type SpyObject<T> = BaseSpyObject<T> & { [P in keyof T]: T[P] & (T[P] extends (...args: any[]) => infer R ? jest.Mock<R> : T[P]) };
7+
export type SpyObject<T> = BaseSpyObject<T> &
8+
{ [P in keyof T]: T[P] & (T[P] extends (...args: any[]) => infer R ? (R extends (...args: any[]) => any ? jest.Mock<R> : T[P]) : T[P]) };
89

910
/**
1011
* @publicApi

0 commit comments

Comments
 (0)