Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tb-mocker

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tb-mocker

Generate test data, company with tb-schema.

  • 0.17.7
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

tb-mocker

Generate test data, company with tb-schema.

Currently Constructors:

  1. ✓ Activity
  2. ✓ Apprelation
  3. ✓ Collection
  4. ✓ Consumer
  5. ✓ Customfield
  6. ✓ Devicetoken
  7. ✓ Entry
  8. ✓ Event
  9. ✓ Feedback
  10. ✓ Group
  11. ✓ Integration
  12. ✓ Member
  13. ✓ Message
  14. ✓ Notice
  15. ✓ Organization
  16. ✓ Post
  17. ✓ Project
  18. ✓ Projecttemplate
  19. ✓ Rule
  20. ✓ Stage
  21. ✓ Subscriber
  22. ✓ Subtask
  23. ✓ Tag
  24. ✓ Task
  25. ✓ Tasklist
  26. ✓ Team
  27. ✓ Token
  28. ✓ User
  29. ✓ View
  30. ✓ Work
  31. ✓ Worktime
  32. ✓ Sprint
  33. ✓ tagcategory

API

mocker.Mocker

The base class.

mocker.constructors

console.log(mocker.constructors)
// [ 'Activity',
//   'Apprelation',
//   'Collection',
//   'Consumer',
//   'Customfield',
//   'Devicetoken',
//   'Entry',
//   'Event',
//   'Feedback',
//   'Integration',
//   'Member',
//   'Notice',
//   'Organization',
//   'Post',
//   'Project',
//   'Projecttemplate',
//   'Stage',
//   'Subscriber',
//   'Subtask',
//   'Smartgroup',
//   'Tag',
//   'Task',
//   'Tasklist',
//   'Team',
//   'Token',
//   'User',
//   'View',
//   'Work' ]

mocker[constructor] , mocker[Constructor] , mocker[Constructor + 'Model']

A example for User:

  • mocker.user(): Return simple mocker user.

    console.log(mocker.user())
    // User {
    //   name: 'name0',
    //   email: 'email0@mocker.org',
    //   emails: [ { email: 'email0@mocker.org', state: 0 } ],
    //   password: 'sha1$303cee$d4b5b28cf8c06200000d890bd401a85a8b6556ed',
    //   authUpdated: 1458818469463 }
    
  • mocker.user(obj): Return simple mocker user with custom data.

    console.log(mocker.user({name: 'tester', email: 'tester@tb.com'}))
    // User {
    //   name: 'tester',
    //   email: 'tester@tb.com',
    //   emails: [ { email: 'tester@tb.com', state: 0 } ],
    //   password: 'sha1$303cee$d4b5b28cf8c06200000d890bd401a85a8b6556ed',
    //   authUpdated: 1458818487941 }
    
  • new mocker.User(): Same as mocker.user().

  • new mocker.UserModel(mocker.user()): Return mongoose user model.

    console.log(new mocker.UserModel(mocker.user()))
    // { emails:
    //    [ { _id: 56f25241d4d16b31888c0e80,
    //        state: 0,
    //        email: 'email0@mocker.org' } ],
    //   title: '',
    //   location: '',
    //   website: '',
    //   created: Wed Mar 23 2016 16:22:25 GMT+0800 (CST),
    //   updated: Wed Mar 23 2016 16:22:25 GMT+0800 (CST),
    //   isActive: false,
    //   isAdmin: false,
    //   isBlock: false,
    //   isPay: false,
    //   latestActived: null,
    //   hasLoginToday: false,
    //   hasLoginTalk: false,
    //   googleTwoFactor: null,
    //   signUpIP: null,
    //   signUpCity: null,
    //   lastEntered: {},
    //   _id: 56f25241d4d16b31888c0e7f,
    //   authUpdated: 1458721345492,
    //   password: 'sha1$303cee$d4b5b28cf8c06200000d890bd401a85a8b6556ed',
    //   email: 'email0@mocker.org',
    //   name: 'name0' }
    

Keywords

FAQs

Package last updated on 31 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc