omermorad / mockingbird

🐦 Decorator Powered TypeScript Library for Creating Mocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: create 'pick' functionality to pick only what's needed

omermorad opened this issue · comments

Add new functionality to enable to pick only what's needed in the generated mock, here is an example:

class Bird {
  @Mock((faker) => faker.random.uuid())
  uid: string;

  @Mock((faker) => faker.name.firstName())
  name: string;
  
  @Mock()
  canFly: boolean;
}

const mock = MockFactory<Bird>(Bird).pick('uid', 'name').one();