@testrevolution/bugbug-cli 8.15.0 → 8.16.0
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
CHANGED
|
@@ -32,6 +32,17 @@ describe('commands stop module', () => {
|
|
|
32
32
|
settings.API_URL = 'https://bugbug.io/test-api/';
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
+
it('should return error when testRunId is missing', async () => {
|
|
36
|
+
const consoleLogSpy = jest.spyOn(console, 'error').mockImplementation();
|
|
37
|
+
const args = {
|
|
38
|
+
_: ['remote', 'stop', 'test'],
|
|
39
|
+
noprogress: true,
|
|
40
|
+
};
|
|
41
|
+
await remoteCommand(args);
|
|
42
|
+
|
|
43
|
+
expect(consoleLogSpy).toHaveBeenNthCalledWith(1, 'Missing testRun id.');
|
|
44
|
+
});
|
|
45
|
+
|
|
35
46
|
it('stop test command should call API', async () => {
|
|
36
47
|
const consoleLogSpy = jest.spyOn(console, 'error').mockImplementation();
|
|
37
48
|
axios.mockResolvedValueOnce(apiMocks.stopTestRunRunSuccess);
|
package/src/commands/remote.js
CHANGED
|
@@ -131,12 +131,16 @@ const run = async (type, data, extraParams) => {
|
|
|
131
131
|
const stop = async (type, { id }, extraParams) => {
|
|
132
132
|
const { noprogress } = extraParams;
|
|
133
133
|
const route = settings.API_ROUTING[`${type}Stop`];
|
|
134
|
+
const spinner = getSpinner(noprogress);
|
|
135
|
+
|
|
136
|
+
if (!id) {
|
|
137
|
+
spinner.fail(`Missing ${type}Run id.`);
|
|
138
|
+
return getExitCode(false);
|
|
139
|
+
}
|
|
134
140
|
|
|
135
141
|
const path = format(route.path, id);
|
|
136
142
|
|
|
137
|
-
const spinner = getSpinner(noprogress);
|
|
138
143
|
try {
|
|
139
|
-
console.log('stop');
|
|
140
144
|
const response = await apiCall(path, route.method, {}, {}, extraParams.triggeredBy);
|
|
141
145
|
printStatus(spinner, response.data.status);
|
|
142
146
|
|