Releases: tiloio/test-randomizing
Releases · tiloio/test-randomizing
0.5.1 - Creator function possibility for freezeMergeFactory
freezeMergeFactory
can now be called with an object or a function.
// called with function
const randomNumber = freezeMergeFactory(() => Math.random());
randomNumber() === randomNumber() // depends on the randomness
// called with object
const randomNumber = freezeMergeFactory(Math.random());
randomNumber() === randomNumber() // is always true
0.5.0 Introduce freezeMergeFactory
Introduce freezeMergeFactory
to have simpler handling in tests.
# Example
import { freezeMergeFactory } from "https://x.nest.land/[email protected]/mod.ts";
const randomPerson = freezeMergeFactory<Person>({
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
companyName: faker.company.companyName(),
});
Deno.test("consist of [email protected]", () => {
const person = randomPerson({
firstName: "steve",
lastName: "jobs",
companyName: "apple",
});
const email = generateEmail(person);
assertEquals(email, "[email protected]");
});
0.4.1 Docs
Some documentation.
0.4.0 Sync version with nest.land, deno.land and npm
0.2.1 Fix entrypoint
Entrypoint with mod.ts
like deno best practices.
0.2.0 Deep freeze merge
Freeze merge freezes now nested properties, objects and arrays.
Full Changelog: https://github.com/tiloio/test-randomizing/commits/0.2.0