Skip to content

Dynamic generation based on generated values #14

@matiaslopezd

Description

@matiaslopezd

The idea is to generate the value by key-passing the generated object like this:

const schema = new Schema({
  ...,
  date: { ... },
  duration: {
     type: Number,
     dummy(mock) {
         return Date.now() - this.schema.generated.date; // Use another key to generate other
     } 
  }
});

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions