How to use the faker.system 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 BoostIO / Boostnote / tests / dataApi / deleteNote.js View on Github external
test.serial('Delete a note', (t) => {
  const storageKey = t.context.storage.cache.key
  const folderKey = t.context.storage.json.folders[0].key

  const input1 = {
    type: 'SNIPPET_NOTE',
    description: faker.lorem.lines(),
    snippets: [{
      name: faker.system.fileName(),
      mode: 'text',
      content: faker.lorem.lines()
    }],
    tags: faker.lorem.words().split(' '),
    folder: folderKey
  }
  input1.title = input1.description.split('\n').shift()

  return Promise.resolve()
    .then(function doTest () {
      return createNote(storageKey, input1)
        .then(function (data) {
          return deleteNote(storageKey, data.key)
        })
    })
    .then(function assert (data) {
github BoostIO / Boostnote / tests / fixtures / TestDummy.js View on Github external
function dummyNote (override = {}) {
  var data = Math.random() > 0.5
    ? {
      type: 'MARKDOWN_NOTE',
      content: faker.lorem.lines()
    }
    : {
      type: 'SNIPPET_NOTE',
      description: faker.lorem.lines(),
      snippets: [{
        name: faker.system.fileName(),
        mode: 'text',
        content: faker.lorem.lines()
      }]
    }
  data.title = data.type === 'MARKDOWN_NOTE'
    ? data.content.split('\n').shift()
    : data.description.split('\n').shift()
  data.createdAt = faker.date.past()
  data.updatedAt = faker.date.recent()
  data.isStarred = false
  data.tags = faker.lorem.words().split(' ')

  if (override.key == null) data.key = keygen()
  if (override.folder == null) data.folder = keygen()
  Object.assign(data, override)
github BoostIO / Boostnote / tests / dataApi / createNote.js View on Github external
test.serial('Create a note', (t) => {
  const storageKey = t.context.storage.cache.key
  const folderKey = t.context.storage.json.folders[0].key

  const input1 = {
    type: 'SNIPPET_NOTE',
    description: faker.lorem.lines(),
    snippets: [{
      name: faker.system.fileName(),
      mode: 'text',
      content: faker.lorem.lines()
    }],
    tags: faker.lorem.words().split(' '),
    folder: folderKey
  }
  input1.title = input1.description.split('\n').shift()

  const input2 = {
    type: 'MARKDOWN_NOTE',
    content: faker.lorem.lines(),
    tags: faker.lorem.words().split(' '),
    folder: folderKey
  }
  input2.title = input2.content.split('\n').shift()
github flow-typed / flow-typed / definitions / npm / faker_v4.x.x / flow_v0.104.x- / test_faker_v4.x.x.js View on Github external
describe("system", () => {
  faker.system.fileName();
  faker.system.fileName("ext");
  faker.system.fileName("ext", "type");
  faker.system.commonFileName();
  faker.system.mimeType();
  faker.system.commonFileType();
  faker.system.commonFileType("ext");
  faker.system.commonFileType("ext", "type");
  faker.system.commonFileExt();
  faker.system.commonFileExt("type");
  faker.system.fileType();
  faker.system.fileExt();
  faker.system.fileExt("mimeType");
  faker.system.directoryPath();
  faker.system.filePath();
  faker.system.semver();
});
github nickpisacane / websync / test / utils.ts View on Github external
import * as faker from 'faker'
import * as minimatch from 'minimatch'
import {
  Item,
  Container,
  ContainerType,
  ListItemsOptions,
} from '../src/types'

export class MockItem implements Item {
  public key: string = faker.system.fileName('js', 'js')
  public modtime: Date = faker.date.past()
  public size: number = faker.random.number({ min: 64, max: 1024 })
  public isSymbolicLink: boolean = false

  constructor(item: Partial = {}) {
    Object.assign(this, item)
  }

  public read(): Promise {
    return Promise.resolve(new Buffer(this.size))
  }
}

const randomContainerType = (): ContainerType =>
  ['FILE' as ContainerType, 'S3' as ContainerType][Math.floor(Math.random() * 2)]
github flow-typed / flow-typed / definitions / npm / faker_v4.x.x / flow_v0.104.x- / test_faker_v4.x.x.js View on Github external
describe("system", () => {
  faker.system.fileName();
  faker.system.fileName("ext");
  faker.system.fileName("ext", "type");
  faker.system.commonFileName();
  faker.system.mimeType();
  faker.system.commonFileType();
  faker.system.commonFileType("ext");
  faker.system.commonFileType("ext", "type");
  faker.system.commonFileExt();
  faker.system.commonFileExt("type");
  faker.system.fileType();
  faker.system.fileExt();
  faker.system.fileExt("mimeType");
  faker.system.directoryPath();
  faker.system.filePath();
  faker.system.semver();
});
github Canner / canner / packages / canner-helpers / src / createFakeData.js View on Github external
__typename: null,
          lat: faker.address.latitude(),
          lng: faker.address.longitude(),
          address: faker.address.city(),
          placeId: faker.random.uuid()
        };
        break;
      case 'dateTime':
        result = faker.date.past().toISOString();
        break;
      case 'file':
        result = {
          __typename: null,
          contentType: faker.system.mimeType(),
          size: faker.random.number(),
          name: faker.system.commonFileName(),
          url: faker.internet.url()
        };
        break;
      case 'image':
        result = {
          __typename: null,
          contentType: 'image/jpeg',
          size: faker.random.number(),
          name: faker.system.commonFileName(),
          url: randomImg()
        };
        break;
      case 'boolean':
        result = faker.random.boolean();
        break;
      case 'string': {
github lestoni / faker-cli / index.js View on Github external
function getSystem(options){
  return faker.system[options.type] &&
        faker.system[options.type]();
}
github lestoni / faker-cli / index.js View on Github external
function getSystem(options){
  return faker.system[options.type] &&
        faker.system[options.type]();
}
github webkom-co / airframe-next / app / routes / Tables / Tables / components / TrTableResponsive.js View on Github external
<i></i>
                    
                    
                        
                            
                                <i></i>
                            
                            
                                <div>
                                    <span>
                                        { browserOs[index%4] } 
                                    </span> / 
                                    { faker.system.semver() }
                                </div>
                                <span>
                                    macOs { faker.system.semver() }
                                </span>
                            
                        
                    
                    
                        <div>
                            <samp>
                                { faker.internet.ip() }
                            </samp>
                        </div>
                        <span>
                            -
                        </span>
                    
                    
                        <div></div>