tb-mocker
Generate test data, company with tb-schema.
Currently Constructors:
- ✓ Activity
- ✓ Apprelation
- ✓ Collection
- ✓ Consumer
- ✓ Customfield
- ✓ Devicetoken
- ✓ Entry
- ✓ Event
- ✓ Feedback
- ✓ Group
- ✓ Integration
- ✓ Member
- ✓ Message
- ✓ Notice
- ✓ Organization
- ✓ Post
- ✓ Project
- ✓ Projecttemplate
- ✓ Rule
- ✓ Stage
- ✓ Subscriber
- ✓ Subtask
- ✓ Tag
- ✓ Task
- ✓ Tasklist
- ✓ Team
- ✓ Token
- ✓ User
- ✓ View
- ✓ Work
- ✓ Worktime
- ✓ Sprint
- ✓ tagcategory
API
mocker.Mocker
The base class.
mocker.constructors
console.log(mocker.constructors)
mocker[constructor] , mocker[Constructor] , mocker[Constructor + 'Model']
A example for User
:
-
mocker.user(): Return simple mocker user.
console.log(mocker.user())
-
mocker.user(obj): Return simple mocker user with custom data.
console.log(mocker.user({name: 'tester', email: 'tester@tb.com'}))
-
new mocker.User(): Same as mocker.user().
-
new mocker.UserModel(mocker.user()): Return mongoose user model.
console.log(new mocker.UserModel(mocker.user()))