package.cypress-utils.fixtures.fake.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
import { faker } from "@faker-js/faker";
var fake = {};
var email = function email() {
return faker.internet.exampleEmail().toLowerCase();
};
var number = function number() {
return faker.number["int"]({
min: 3,
max: 9
});
};
var amount = function amount() {
return faker.number["int"]({
min: 1,
max: 5
});
};
var randomString = function randomString() {
return faker.string.alphanumeric(10);
};
var quantity = function quantity() {
return faker.number["int"]({
min: 1,
max: 3
});
};
var randomDay = function randomDay() {
return faker.number["int"]({
min: 1,
max: 27
});
};
var percentage = function percentage() {
return faker.number["int"]({
min: 1,
max: 2
});
};
var uniqueName = function uniqueName() {
return faker.person.firstName() + faker.number["int"]({
min: 1,
max: 100
});
};
var uniqueDepartment = function uniqueDepartment() {
return faker.commerce.department() + faker.number["int"]({
min: 1,
max: 100
});
};
var phoneNumber = function phoneNumber() {
var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "9#########";
return faker.phone.number(format);
};
var secureUrl = function secureUrl() {
return faker.internet.url().replace("http:", "https:");
};
var otp = function otp() {
return faker.number["int"]({
min: 100000,
max: 999999
});
};
var longNumber = function longNumber() {
return faker.number["int"]({
min: 1000,
max: 9999
});
};
var decimalNumber = function decimalNumber() {
return faker.number["int"]({
min: 1000,
max: 9999
}) + Math.random();
};
Object.defineProperty(fake, "firstName", {
get: faker.person.firstName
});
Object.defineProperty(fake, "middleName", {
get: faker.person.middleName
});
Object.defineProperty(fake, "lastName", {
get: faker.person.lastName
});
Object.defineProperty(fake, "fullName", {
get: faker.person.fullName
});
Object.defineProperty(fake, "companyName", {
get: faker.company.name
});
Object.defineProperty(fake, "streetName", {
get: faker.location.street
});
Object.defineProperty(fake, "city", {
get: faker.location.city
});
Object.defineProperty(fake, "zipCode", {
get: faker.location.zipCode
});
Object.defineProperty(fake, "country", {
get: faker.location.country
});
Object.defineProperty(fake, "sentence", {
get: faker.lorem.sentence
});
Object.defineProperty(fake, "email", {
get: email
});
Object.defineProperty(fake, "number", {
get: number
});
Object.defineProperty(fake, "amount", {
get: amount
});
Object.defineProperty(fake, "projectName", {
get: faker.commerce.productName
});
Object.defineProperty(fake, "department", {
get: faker.commerce.department
});
Object.defineProperty(fake, "word", {
get: faker.lorem.word
});
Object.defineProperty(fake, "words", {
get: faker.lorem.words
});
Object.defineProperty(fake, "randomString", {
get: randomString
});
Object.defineProperty(fake, "state", {
get: faker.location.state
});
Object.defineProperty(fake, "quantity", {
get: quantity
});
Object.defineProperty(fake, "randomDay", {
get: randomDay
});
Object.defineProperty(fake, "percentage", {
get: percentage
});
Object.defineProperty(fake, "uniqueName", {
get: uniqueName
});
Object.defineProperty(fake, "uniqueDepartment", {
get: uniqueDepartment
});
Object.defineProperty(fake, "url", {
get: faker.internet.url
});
Object.defineProperty(fake, "secureUrl", {
get: secureUrl
});
Object.defineProperty(fake, "domain", {
get: faker.internet.domainName
});
Object.defineProperty(fake, "otp", {
get: otp
});
Object.defineProperty(fake, "longNumber", {
get: longNumber
});
Object.defineProperty(fake, "decimalNumber", {
get: decimalNumber
});
Object.defineProperty(fake, "streetAddress", {
get: faker.location.streetAddress
});
fake.phoneNumber = phoneNumber;
export { fake };
//# sourceMappingURL=fake.js.map