Skip to content

faker.finance.amount with arguments doesn't work  #127

Description

@kamilwu

Hi, If I try to generate some data using faker.finance.amount, mocker-data-generator fails with the following error:

Error: Schema: "example" Error: "faker" Error: Max  10 should be greater than min 5.

Here's a code that can be used to reproduce the issue:

import { faker } from "@faker-js/faker";
import { mocker } from "mocker-data-generator";

mocker()
    .addGenerator("faker", faker)
    .schema("example", { amount: { faker: "finance.amount(5, 10)" } }, 1)
    .buildSync()["example"];

I'm using the following versions:

mocker-data-generator: 3.0.3
@faker-js/faker: 7.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions