google / intermock

Mocking library to create mock objects with fake data for TypeScript interfaces
https://google.github.io/intermock/
Apache License 2.0
1.14k stars 71 forks source link

Feature request: Allow extending/overwriting smart-props #52

Open yonatan-capitolis opened 3 years ago

yonatan-capitolis commented 3 years ago

smart-props are currently hard-coded here: https://github.com/google/intermock/blob/master/src/lib/smart-props.ts#L16

It would be useful to be able to extend the Options API with smart-props support like so (possibly in a config file when used from CLI):

mock({
  smartProps: {
    // can be a value
    propA: 'some text value',
    // can be a function
    propB() {
      return Math.random()
    }
  }
})