fix(tests): make mocks for rest octokit async

This commit is contained in:
lowlighter
2022-04-23 16:31:22 -04:00
parent 0d25379ff4
commit e9f9bcc678
12 changed files with 13 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
/**Mocked data */
export default function({ faker }, target, that, [{ username: login, page, per_page }]) {
export default async function({ faker }, target, that, [{ username: login, page, per_page }]) {
console.debug("metrics/compute/mocks > mocking rest api result > rest.activity.listEventsForAuthenticatedUser")
return ({
status: 200,

View File

@@ -2,7 +2,7 @@
import listEventsForAuthenticatedUser from "./listEventsForAuthenticatedUser.mjs"
/**Mocked data */
export default function({ faker }, target, that, [{ username: login, page, per_page }]) {
export default async function({ faker }, target, that, [{ username: login, page, per_page }]) {
console.debug("metrics/compute/mocks > mocking rest api result > rest.activity.listRepoEvents")
return listEventsForAuthenticatedUser(...arguments)
}

View File

@@ -1,5 +1,5 @@
/**Mocked data */
export default function({ faker }, target, that) {
export default async function({ faker }, target, that) {
console.debug("metrics/compute/mocks > mocking rest api result > rest.emojis.get")
return ({
status: 200,

View File

@@ -1,5 +1,5 @@
/**Mocked data */
export default function({ faker }, target, that, args) {
export default async function({ faker }, target, that, args) {
return ({
status: 200,
url: "https://api.github.com/rate_limit",

View File

@@ -1,5 +1,5 @@
/**Mocked data */
export default function({ faker }, target, that, [{ owner, repo }]) {
export default async function({ faker }, target, that, [{ owner, repo }]) {
console.debug("metrics/compute/mocks > mocking rest api result > rest.repos.getContributorsStats")
return ({
status: 200,

View File

@@ -1,5 +1,5 @@
/**Mocked data */
export default function({ faker }, target, that, [{ owner, repo }]) {
export default async function({ faker }, target, that, [{ owner, repo }]) {
console.debug("metrics/compute/mocks > mocking rest api result > rest.repos.getViews")
const count = faker.datatype.number(10000) * 2
const uniques = faker.datatype.number(count) * 2

View File

@@ -1,5 +1,5 @@
/**Mocked data */
export default function({ faker }, target, that, [{ page, per_page, owner, repo }]) {
export default async function({ faker }, target, that, [{ page, per_page, owner, repo }]) {
console.debug("metrics/compute/mocks > mocking rest api result > rest.repos.listCommits")
return ({
status: 200,

View File

@@ -1,5 +1,5 @@
/**Mocked data */
export default function({ faker }, target, that, [{ owner, repo }]) {
export default async function({ faker }, target, that, [{ owner, repo }]) {
console.debug("metrics/compute/mocks > mocking rest api result > rest.repos.listContributors")
return ({
status: 200,

View File

@@ -1,5 +1,5 @@
/**Mocked data */
export default function({ faker }, target, that, args) {
export default async function({ faker }, target, that, args) {
//Arguments
const [url] = args
//Head request

View File

@@ -1,5 +1,5 @@
/**Mocked data */
export default function({ faker }, target, that, [{ username }]) {
export default async function({ faker }, target, that, [{ username }]) {
console.debug("metrics/compute/mocks > mocking rest api result > rest.repos.getByUsername")
return ({
status: 200,

View File

@@ -1,5 +1,5 @@
/**Mocked data */
export default function({ faker }, target, that, [{ username }]) {
export default async function({ faker }, target, that, [{ username }]) {
console.debug("metrics/compute/mocks > mocking rest api result > rest.users.listGpgKeysForUser")
return ({
status: 200,