@forwardimpact/libmock 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/mock/gh-client.js +8 -1
package/package.json
CHANGED
package/src/mock/gh-client.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { spy } from "./spy.js";
|
|
2
2
|
|
|
3
|
-
const GH_METHODS = [
|
|
3
|
+
const GH_METHODS = [
|
|
4
|
+
"prCreate",
|
|
5
|
+
"prMerge",
|
|
6
|
+
"apiGet",
|
|
7
|
+
"apiGetPaginated",
|
|
8
|
+
"apiPost",
|
|
9
|
+
];
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
12
|
* Creates a mock `GhClient` collaborator. Each method is a spy returning the
|
|
@@ -20,6 +26,7 @@ export function createMockGhClient({ responses = {} } = {}) {
|
|
|
20
26
|
calls.push({ method, args });
|
|
21
27
|
if (method in responses) return responses[method];
|
|
22
28
|
if (method === "prCreate") return "";
|
|
29
|
+
if (method === "apiGetPaginated") return [];
|
|
23
30
|
return null;
|
|
24
31
|
});
|
|
25
32
|
}
|