tests: move mocks to tests/*
This commit is contained in:
22
tests/mocks/api/github/graphql/discussions.comments.mjs
Normal file
22
tests/mocks/api/github/graphql/discussions.comments.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > discussions/comments")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
repositoryDiscussionsComments:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
}
|
||||
}
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repositoryDiscussionsComments:{
|
||||
edges:new Array(100).fill(null).map(_ => ({cursor:"MOCKED_CURSOR"})),
|
||||
nodes:new Array(100).fill(null).map(_ => ({upvoteCount: faker.datatype.number(10)}))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user