File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -17,29 +17,33 @@ interface Person {
1717const mock = createMock <Person >();
1818mock .id // ""
1919mock .getName () // ""
20- mock .details // "{ phone: 0} "
20+ mock .details // { phone: 0 }
2121```
2222
23- ## Default values
23+ ## Property overrides
24+
25+ If you desire, you may override the otherwise mocked properties of an interface.
26+
27+ You don't have to provide the entire interface, just a partial object of the one you are mocking.
2428
25- You can also define default values to overrides specific fields
26- You dont have to provide the entire interface, just a partial of the one to mock
2729``` ts
2830import { createMock } from ' ts-auto-mock' ;
2931
3032interface Person {
3133 id: string ;
3234 getName(): string ;
3335 details: {
34- phone: number
36+ phone: number
3537 }
3638}
39+
3740const mock = createMock <Person >({
3841 details: {
39- phone: 07423232323
42+ phone: 7423232323
4043 }
4144});
45+
4246mock .id // ""
4347mock .getName () // ""
44- mock .details // "{ phone: 07423232323} "
48+ mock .details // { phone: 7423232323 }
4549```
You can’t perform that action at this time.
0 commit comments