File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -462,12 +462,10 @@ type DeepPartialMock<T extends Procedure | Constructable = Procedure> = Mock<
462462export type MaybeMockedConstructor < T > = T extends Constructable
463463 ? Mock < T >
464464 : T
465- export type MockedFunction < T extends Procedure | Constructable > = Mock < T > & {
466- [ K in keyof T ] : T [ K ] ;
467- }
468- export type PartiallyMockedFunction < T extends Procedure | Constructable > = PartialMock < T > & {
469- [ K in keyof T ] : T [ K ] ;
470- }
465+ export type MockedFunction < T extends Procedure | Constructable > = Mock < T >
466+ & MockedObject < T >
467+ export type PartiallyMockedFunction < T extends Procedure | Constructable > = PartialMock < T >
468+ & MockedObject < T >
471469export type MockedFunctionDeep < T extends Procedure | Constructable > = Mock < T >
472470 & MockedObjectDeep < T >
473471export type PartiallyMockedFunctionDeep < T extends Procedure | Constructable > = DeepPartialMock < T >
Original file line number Diff line number Diff line change @@ -151,6 +151,10 @@ describe('testing vi utils', () => {
151151 public getBar ( ) : string {
152152 return this . bar
153153 }
154+
155+ static getBaz ( ) : string {
156+ return 'baz'
157+ }
154158 }
155159 class FooMock implements Mocked < Foo > {
156160 readonly barMock : Mock < ( ) => string > = vi . fn ( )
@@ -168,6 +172,8 @@ describe('testing vi utils', () => {
168172 if ( 0 ) {
169173 vi . mocked ( Foo ) . mockImplementation ( FooMock )
170174 vi . mocked ( Foo ) . mockImplementation ( Foo )
175+ vi . mocked ( Foo ) . getBaz . mockImplementation ( ( ) => 'baz' )
176+ vi . mocked ( Foo , { partial : true } ) . getBaz . mockImplementation ( ( ) => 'baz' )
171177 }
172178 } )
173179
You can’t perform that action at this time.
0 commit comments