plugin-faker

A plugin to make Faker availabe on the Fluse context.

Install#

yarn add -D fluse-plugin-faker faker @types/faker
tip

This plugin requires faker to be installed as well.

Example#

import { fluse } from "fluse";
import fakerPlugin from "fluse-plugin-faker";
const { fixture, scenario } = fluse({
plugins: {
faker: fakerPlugin(),
},
});
const userFixture = fixture<User>({
create({ faker }) {
const user = new User({
username: faker.internet.userName(),
});
return user;
},
});

API Reference#

The faker api will become available on the context and a runtime option as you use this plugin.

Signature#

fakerPlugin(options?: { faker?: FakerStatic }) => Plugin