-
Notifications
You must be signed in to change notification settings - Fork 0
/
testData.js
50 lines (43 loc) · 1.2 KB
/
testData.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const TOTAL_USERS = 11;
const TOTAL_POSTS = 11;
const COMMENTS_PER_POST = 25;
const createUsers = () => {
let userArray = [];
for (let i = 1; i < TOTAL_USERS; i++) {
userArray.push({
email: `user${i}@test.com`,
passwordHash: 'password'
})
}
return userArray
}
const createPosts = () => {
let postArray = [];
for (let i = 1; i < TOTAL_USERS; i++) {
for (let j = i; j < TOTAL_POSTS; j++) {
postArray.push({
userId: i,
photoUrl: `{www.${j}.com}`,
caption: `picture of ${i} + ${j}`,
tags: ['#blessed', '#nofilter']
})
}
}
return postArray;
}
const createComments = () => {
let commentArray = [];
for (let i = 1; i < TOTAL_USERS; i++) {
for (let j = 1; j < TOTAL_POSTS; j++) {
for (let k = j; k < COMMENTS_PER_POST; k++) {
commentArray.push({
commentBy: i,
postId: j,
comment: `representing ${i} ${j} ${k}`
})
}
}
}
return commentArray;
}
module.exports = { createUsers, createPosts, createComments }