Skip to content

Commit 4959ed9

Browse files
committed
chore(*): Rename __factory identifier to __ident and apply it to mocked methods as well
1 parent 31945d2 commit 4959ed9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/extension/method/provider/provider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { applyIdentityProperty } from '../../../utils/applyIdentityProperty';
12
import { functionMethod } from './functionMethod';
23
// eslint-disable-next-line @typescript-eslint/no-explicit-any
34
type Method = (name: string, value: any) => () => any;
@@ -45,6 +46,10 @@ export class Provider {
4546
return this._method(name, value());
4647
}
4748

48-
return this._method(name, value);
49+
// FIXME: Do this smarter, it's a bit counter intuitive to return a new
50+
// proxy every single time this function is called. It should probably mock
51+
// based on name if that ends up being a string representing the type
52+
// signature.
53+
return applyIdentityProperty(this._method, name)(name, value);
4954
}
5055
}

0 commit comments

Comments
 (0)