How to use the faker.internet function in faker

To help you get started, we’ve selected a few faker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github puzzle-js / puzzle-warden / test / request-manager.spec.ts View on Github external
it("should handle request without custom headers", () => {
// Arrange
    const name = faker.random.word();
    const requestOptions: WardenRequestOptions = {
      url: faker.internet.url(),
      method: 'get'
    };
    const routeConfiguration = {
      identifier: faker.random.word()
    } as RouteConfiguration;
    const headStream = {
      connect: sandbox.stub().returnsArg(0),
      start: sandbox.stub()
    };
    const networkStream = {
      connect: sandbox.stub().returnsArg(0)
    };
    const key = faker.random.word();
    const keyMaker = sandbox.stub().returns(key);
    streamFactoryMock.expects('createHead').withExactArgs().returns(headStream);
    streamFactoryMock.expects('createNetwork').withExactArgs(name).returns(networkStream);
github taskill / taskill / server / db / seed.js View on Github external
await timesAsync(4, async n => {
    // Создаем пользователя
    const name = faker.name.firstName()

    const user = new User({
      name: name,
      username: name.toLocaleLowerCase(),
      email: faker.internet.email(),
      password: '123456'
    })
    await user.save()

    // Создаем проект
    const project = new Project({
      title: `Project-${n + 1}`,
      slug: `project-${n + 1}`,
      key: faker.hacker
        .adjective()
        .slice(0, 3)
        .toUpperCase(),
      description: faker.lorem.sentence(3),
      taskIncId: 0
    })
    // Добавляем проекту владельца
github percy / react-percy / integration-tests / react-percy-storybook / stories / index.js View on Github external
In Percy's screenshot (but not local dev) the current date should be frozen to 2015
      thanks to mockdate and inPercy.
    <p></p>
    <p>
      See storybook/config.js or&nbsp;
      <a href="https://github.com/boblauer/MockDate">mockdate's docs</a>
      &nbsp;for how it's configured.
    </p>
    <p>
      The current date is: {new Date().toLocaleDateString()}
    </p>
  ,
);

const name = faker.name.findName();
const email = faker.internet.email();

storiesOf('Managing Dynamic Data.Faker', module).add('Show a fake name and email', () =&gt;
  <div>
    <p>
      In Percy's screenshot (but not local dev) the fake data should be the same thanks to
      faker's seed and inPercy.
    </p>
    <p>
      See storybook/config.js or&nbsp;
      <a href="https://www.npmjs.com/package/faker#setting-a-randomness-seed">faker's docs</a>
      &nbsp;for how it's configured.
    </p>
    <p>
      The name is: {name}
    </p>
    <p></p></div>
github epochtalk / epochtalk / test / db / seed / fake.js View on Github external
fake.users = function() {
  var user = {
    password: faker.internet.password(),
    email: faker.internet.email(),
    username: faker.internet.userName()
  };
  return Promise.resolve(user).then(db.users.create);
};
github berty / berty / js / packages / berty-storybook / faker.gen.tsx View on Github external
.map((_, index) =&gt; ({
					id: index,
					protocolId: '',
					createdAt: timestamp(_faker.date.recent()),
					updatedAt: timestamp(_faker.date.recent()),
					title: _faker.name.findName(),
					topic: _faker.random.words(),
					avatarUri: _faker.internet.avatar(),
					kind: randomValue(_api.berty.chatmodel.Conversation.Kind),
					badge: _faker.random.number() % 20,
					messages: [],
					members: [],
					lastMessageId: _faker.random.number() % 50,
					lastMessage: null,
				}))
			export const Member: Array&lt;_api.berty.chatmodel.IMember&gt; = randomArray(20)
github webkom-co / airframe-next / features / Tables / TrTableBorderless.js View on Github external
<a id="UncontrolledTooltipDownload" href="#">
            <i></i>
        </a>
        
            Download
        
    ,
    
    
];
/*eslint-enable */
/*eslint-disable */
const paymentMethod = [
    
        <i></i>
        { faker.internet.email() }
    ,
    
        <i></i>
        Visa 4*** **** **** 9221
    
];
/*eslint-enable */
/*eslint-disable */
const status = [
    
        <i></i>
    ,
    
        <i></i>
    
];
github staticdeploy / staticdeploy / management-console / mock-server / generators.ts View on Github external
export const entrypoint = (supplied: any = {}) => ({
    id: id(),
    appId: id(),
    urlMatcher: `${faker.internet.domainName()}/${faker.hacker.noun()}/`,
    bundleId: Math.random() > 0.5 ? id() : null,
    redirectTo: Math.random() > 0.5 ? faker.internet.url() : null,
    configuration: Math.random() > 0.5 ? { KEY: "VALUE" } : null,
    createdAt: faker.date.past(),
    updatedAt: faker.date.past(),
    ...supplied
});
github mirumee / saleor-storefront / cypress / support / generate.js View on Github external
const userBuilder = () => ({
  email: faker.internet.email(),
  password: faker.internet.password()
});
github erxes / erxes-api / src / db / factories.js View on Github external
export const customerFactory = (params = {}) => {
  const customer = new Customers({
    firstName: params.firstName || faker.random.word(),
    lastName: params.lastName || faker.random.word(),
    email: params.email || faker.internet.email(),
    phone: params.phone || faker.phone.phoneNumber(),
    messengerData: params.messengerData || {},
    customFieldsData: params.customFieldsData || {},
    companyIds: params.companyIds || [faker.random.number(), faker.random.number()],
    tagIds: params.tagIds || [faker.random.number(), faker.random.number()],
    twitterData: params.twitterData || { id: faker.random.number() },
  });

  return customer.save();
};