Improve mocking and debugging with web instance (#91)

This commit is contained in:
Simon Lecoq
2021-02-02 14:05:01 +01:00
committed by GitHub
parent 30956be7b0
commit b8182c4eb5
12 changed files with 40 additions and 36 deletions

View File

@@ -0,0 +1,18 @@
/** Mocked data */
export default function({faker}, target, that, [{username}]) {
console.debug(`metrics/compute/mocks > mocking rest api result > rest.repos.getByUsername`)
return ({
status:200,
url:`'https://api.github.com/users/${username}/`,
headers: {
server:"GitHub.com",
status:"200 OK",
"x-oauth-scopes":"repo",
},
data:{
login:faker.internet.userName(),
avatar_url:null,
contributions:faker.random.number(1000),
}
})
}