fix(ci): octokit.request.defaults is not a function

mocking was not keeping functions with extra properties
This commit is contained in:
Simon Lecoq
2023-08-23 22:59:52 -04:00
parent 54e28d361f
commit e34c90b129

View File

@@ -70,7 +70,7 @@ export default async function({graphql, rest}) {
for (const [key, value] of Object.entries(mocks)) { for (const [key, value] of Object.entries(mocks)) {
console.debug(`metrics/compute/mocks > mocking rest api > mocking ${path}.${key}`) console.debug(`metrics/compute/mocks > mocking rest api > mocking ${path}.${key}`)
if (typeof value === "function") { if (typeof value === "function") {
unmocked[path] = value unmocked[path] = Object.assign(value, mocked[key])
mocked[key] = new Proxy(unmocked[path], {apply: value.bind(null, {faker})}) mocked[key] = new Proxy(unmocked[path], {apply: value.bind(null, {faker})})
} }
else { else {