@whook/create 20.1.2 → 21.0.1
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/dist/services/author.test.js +1 -1
- package/dist/services/author.test.js.map +1 -1
- package/dist/services/createWhook.js +1 -1
- package/dist/services/createWhook.js.map +1 -1
- package/dist/services/createWhook.test.js +404 -377
- package/dist/services/createWhook.test.js.map +1 -1
- package/dist/services/project.js +1 -1
- package/dist/services/project.js.map +1 -1
- package/dist/services/project.test.js +1 -1
- package/dist/services/project.test.js.map +1 -1
- package/package.json +38 -29
- package/src/services/__snapshots__/author.test.ts.snap +1 -1
- package/src/services/__snapshots__/createWhook.test.ts.snap +172 -136
- package/src/services/__snapshots__/project.test.ts.snap +1 -1
- package/src/services/author.test.ts +25 -7
- package/src/services/createWhook.test.ts +496 -421
- package/src/services/createWhook.ts +4 -2
- package/src/services/project.test.ts +1 -1
- package/src/services/project.ts +1 -1
|
@@ -23,8 +23,14 @@ describe('initAuthor', () => {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
test('should work', async () => {
|
|
26
|
-
exec.mockImplementationOnce(
|
|
27
|
-
|
|
26
|
+
exec.mockImplementationOnce(
|
|
27
|
+
(_: unknown, cb: (err: Error | null, data?: string) => undefined) =>
|
|
28
|
+
cb(null, 'Wayne Campbell'),
|
|
29
|
+
);
|
|
30
|
+
exec.mockImplementationOnce(
|
|
31
|
+
(_: unknown, cb: (err: Error | null, data?: string) => undefined) =>
|
|
32
|
+
cb(null, 'wayne@warner.com'),
|
|
33
|
+
);
|
|
28
34
|
lock.take.mockResolvedValueOnce(undefined);
|
|
29
35
|
inquirer.prompt.mockResolvedValueOnce({
|
|
30
36
|
authorName: 'Wayne Campbell',
|
|
@@ -50,8 +56,14 @@ describe('initAuthor', () => {
|
|
|
50
56
|
});
|
|
51
57
|
|
|
52
58
|
test('should handle git failures', async () => {
|
|
53
|
-
exec.mockImplementationOnce(
|
|
54
|
-
|
|
59
|
+
exec.mockImplementationOnce(
|
|
60
|
+
(_: unknown, cb: (err: Error | null, data?: string) => undefined) =>
|
|
61
|
+
cb(new Error('E_GIT_ERROR')),
|
|
62
|
+
);
|
|
63
|
+
exec.mockImplementationOnce(
|
|
64
|
+
(_: unknown, cb: (err: Error | null, data?: string) => undefined) =>
|
|
65
|
+
cb(new Error('E_GIT_ERROR')),
|
|
66
|
+
);
|
|
55
67
|
lock.take.mockResolvedValueOnce(undefined);
|
|
56
68
|
inquirer.prompt.mockResolvedValueOnce({
|
|
57
69
|
authorName: 'Wayne Campbell',
|
|
@@ -77,8 +89,14 @@ describe('initAuthor', () => {
|
|
|
77
89
|
});
|
|
78
90
|
|
|
79
91
|
test('should release the lock on failure', async () => {
|
|
80
|
-
exec.mockImplementationOnce(
|
|
81
|
-
|
|
92
|
+
exec.mockImplementationOnce(
|
|
93
|
+
(_: unknown, cb: (err: Error | null, data?: string) => undefined) =>
|
|
94
|
+
cb(null, 'Wayne Campbell'),
|
|
95
|
+
);
|
|
96
|
+
exec.mockImplementationOnce(
|
|
97
|
+
(_: unknown, cb: (err: Error | null, data?: string) => undefined) =>
|
|
98
|
+
cb(null, 'wayne@warner.com'),
|
|
99
|
+
);
|
|
82
100
|
lock.take.mockResolvedValueOnce(undefined);
|
|
83
101
|
inquirer.prompt.mockRejectedValueOnce(new Error('E_PROMPT_ERROR'));
|
|
84
102
|
lock.release.mockResolvedValueOnce(undefined);
|
|
@@ -93,7 +111,7 @@ describe('initAuthor', () => {
|
|
|
93
111
|
} catch (err) {
|
|
94
112
|
expect({
|
|
95
113
|
errorCode: (err as YError).code,
|
|
96
|
-
|
|
114
|
+
errorDebugValues: (err as YError).debugValues,
|
|
97
115
|
inquirerPromptCalls: inquirer.prompt.mock.calls,
|
|
98
116
|
lockTakeCalls: lock.take.mock.calls,
|
|
99
117
|
lockReleaseCalls: lock.release.mock.calls,
|