@sasjs/cli 6.6.0 → 6.7.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/README.md +2 -1
- package/build/commands/help/help.js +10 -0
- package/build/commands/index.d.ts +1 -0
- package/build/commands/index.js +3 -1
- package/build/commands/logcheck/collectLogs.d.ts +60 -0
- package/build/commands/logcheck/collectLogs.js +386 -0
- package/build/commands/logcheck/logCheckConfig.d.ts +72 -0
- package/build/commands/logcheck/logCheckConfig.js +283 -0
- package/build/commands/logcheck/logcheckCommand.d.ts +6 -0
- package/build/commands/logcheck/logcheckCommand.js +200 -0
- package/build/commands/logcheck/processLogCheck.d.ts +44 -0
- package/build/commands/logcheck/processLogCheck.js +242 -0
- package/build/commands/logcheck/renderLogCheck.d.ts +128 -0
- package/build/commands/logcheck/renderLogCheck.js +423 -0
- package/build/commands/logcheck/spec/collectLogs.spec.d.ts +1 -0
- package/build/commands/logcheck/spec/collectLogs.spec.js +477 -0
- package/build/commands/logcheck/spec/logCheckConfig.spec.d.ts +1 -0
- package/build/commands/logcheck/spec/logCheckConfig.spec.js +323 -0
- package/build/commands/logcheck/spec/logcheckCommand.spec.d.ts +1 -0
- package/build/commands/logcheck/spec/logcheckCommand.spec.js +360 -0
- package/build/commands/logcheck/spec/processLogCheck.spec.d.ts +1 -0
- package/build/commands/logcheck/spec/processLogCheck.spec.js +354 -0
- package/build/commands/logcheck/spec/renderLogCheck.spec.d.ts +1 -0
- package/build/commands/logcheck/spec/renderLogCheck.spec.js +426 -0
- package/build/commands/logcheck/types.d.ts +98 -0
- package/build/commands/logcheck/types.js +14 -0
- package/build/types/command/commandAliases.js +1 -0
- package/build/types/command/commandFactory.js +2 -0
- package/build/types/command/returnCode.d.ts +2 -1
- package/build/types/command/returnCode.js +4 -0
- package/package.json +3 -3
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
47
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
48
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
49
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
50
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
51
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
52
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
56
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
57
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
58
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
59
|
+
function step(op) {
|
|
60
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
61
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
62
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
63
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
64
|
+
switch (op[0]) {
|
|
65
|
+
case 0: case 1: t = op; break;
|
|
66
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
67
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
68
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
69
|
+
default:
|
|
70
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
71
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
72
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
73
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
74
|
+
if (t[2]) _.ops.pop();
|
|
75
|
+
_.trys.pop(); continue;
|
|
76
|
+
}
|
|
77
|
+
op = body.call(thisArg, _);
|
|
78
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
79
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
83
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
84
|
+
if (!m) return o;
|
|
85
|
+
var i = m.call(o), r, ar = [], e;
|
|
86
|
+
try {
|
|
87
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
88
|
+
}
|
|
89
|
+
catch (error) { e = { error: error }; }
|
|
90
|
+
finally {
|
|
91
|
+
try {
|
|
92
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
93
|
+
}
|
|
94
|
+
finally { if (e) throw e.error; }
|
|
95
|
+
}
|
|
96
|
+
return ar;
|
|
97
|
+
};
|
|
98
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
99
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
100
|
+
if (ar || !(i in from)) {
|
|
101
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
102
|
+
ar[i] = from[i];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
106
|
+
};
|
|
107
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
108
|
+
var configModule = __importStar(require("../logCheckConfig"));
|
|
109
|
+
var processModule = __importStar(require("../processLogCheck"));
|
|
110
|
+
var renderModule = __importStar(require("../renderLogCheck"));
|
|
111
|
+
var logcheckCommand_1 = require("../logcheckCommand");
|
|
112
|
+
var utils_1 = require("@sasjs/utils");
|
|
113
|
+
var command_1 = require("../../../types/command");
|
|
114
|
+
var types_1 = require("../types");
|
|
115
|
+
var defaultArgs = ['node', 'sasjs', 'logcheck'];
|
|
116
|
+
var summary = function (overrides) {
|
|
117
|
+
if (overrides === void 0) { overrides = {}; }
|
|
118
|
+
return (__assign({ logs: [], skipped: [], missing: [], unreadable: [], usedDefaultInput: false, searched: ['sasjsresults'], totals: {
|
|
119
|
+
errors: 0,
|
|
120
|
+
warnings: 0,
|
|
121
|
+
notes: 0,
|
|
122
|
+
suppressed: 0,
|
|
123
|
+
logs: 0,
|
|
124
|
+
skipped: 0
|
|
125
|
+
} }, overrides));
|
|
126
|
+
};
|
|
127
|
+
var setupMocks = function () {
|
|
128
|
+
jest
|
|
129
|
+
.spyOn(configModule, 'readLogCheckConfig')
|
|
130
|
+
.mockImplementation(function () { return Promise.resolve(__assign({}, types_1.defaultLogCheckConfig)); });
|
|
131
|
+
jest
|
|
132
|
+
.spyOn(processModule, 'processLogCheck')
|
|
133
|
+
.mockImplementation(function () { return Promise.resolve(summary()); });
|
|
134
|
+
jest.spyOn(renderModule, 'renderLogCheck').mockImplementation(function () { return undefined; });
|
|
135
|
+
process.logger = new utils_1.Logger(utils_1.LogLevel.Off);
|
|
136
|
+
jest.spyOn(process.logger, 'error');
|
|
137
|
+
jest.spyOn(process.logger, 'log');
|
|
138
|
+
};
|
|
139
|
+
describe('LogCheckCommand', function () {
|
|
140
|
+
beforeEach(function () {
|
|
141
|
+
setupMocks();
|
|
142
|
+
});
|
|
143
|
+
it('parses the paths it was given', function () {
|
|
144
|
+
var command = new logcheckCommand_1.LogCheckCommand(__spreadArray(__spreadArray([], __read(defaultArgs), false), ['a.log', 'logs'], false));
|
|
145
|
+
expect(command.name).toEqual('logcheck');
|
|
146
|
+
expect(command.parsed.paths).toEqual(['a.log', 'logs']);
|
|
147
|
+
});
|
|
148
|
+
it('answers to its alias', function () {
|
|
149
|
+
var command = new logcheckCommand_1.LogCheckCommand(['node', 'sasjs', 'lc', 'a.log']);
|
|
150
|
+
expect(command.name).toEqual('logcheck');
|
|
151
|
+
expect(command.parsed.paths).toEqual(['a.log']);
|
|
152
|
+
});
|
|
153
|
+
it('checks the default folder when it is given no path', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
154
|
+
var command;
|
|
155
|
+
return __generator(this, function (_a) {
|
|
156
|
+
switch (_a.label) {
|
|
157
|
+
case 0:
|
|
158
|
+
command = new logcheckCommand_1.LogCheckCommand(defaultArgs);
|
|
159
|
+
return [4 /*yield*/, command.execute()];
|
|
160
|
+
case 1:
|
|
161
|
+
_a.sent();
|
|
162
|
+
expect(processModule.processLogCheck).toHaveBeenCalledWith({
|
|
163
|
+
paths: [],
|
|
164
|
+
config: expect.objectContaining({ failOn: 'error' })
|
|
165
|
+
});
|
|
166
|
+
return [2 /*return*/];
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}); });
|
|
170
|
+
it('passes the flags over the config file', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
171
|
+
var command;
|
|
172
|
+
return __generator(this, function (_a) {
|
|
173
|
+
switch (_a.label) {
|
|
174
|
+
case 0:
|
|
175
|
+
command = new logcheckCommand_1.LogCheckCommand(__spreadArray(__spreadArray([], __read(defaultArgs), false), [
|
|
176
|
+
'--fail-on',
|
|
177
|
+
'warning',
|
|
178
|
+
'--max-warnings',
|
|
179
|
+
'3',
|
|
180
|
+
'--ignore-code',
|
|
181
|
+
'49-169',
|
|
182
|
+
'--ignore-path',
|
|
183
|
+
'legacy/*'
|
|
184
|
+
], false));
|
|
185
|
+
return [4 /*yield*/, command.execute()];
|
|
186
|
+
case 1:
|
|
187
|
+
_a.sent();
|
|
188
|
+
expect(processModule.processLogCheck).toHaveBeenCalledWith({
|
|
189
|
+
paths: [],
|
|
190
|
+
config: expect.objectContaining({
|
|
191
|
+
failOn: 'warning',
|
|
192
|
+
maxWarnings: 3,
|
|
193
|
+
ignoreCodes: ['49-169'],
|
|
194
|
+
ignorePaths: ['legacy/*']
|
|
195
|
+
})
|
|
196
|
+
});
|
|
197
|
+
return [2 /*return*/];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}); });
|
|
201
|
+
it('reads a single value of a repeatable option as a list', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
202
|
+
var command;
|
|
203
|
+
return __generator(this, function (_a) {
|
|
204
|
+
switch (_a.label) {
|
|
205
|
+
case 0:
|
|
206
|
+
command = new logcheckCommand_1.LogCheckCommand(__spreadArray(__spreadArray([], __read(defaultArgs), false), [
|
|
207
|
+
'--ignore-code',
|
|
208
|
+
'22-322'
|
|
209
|
+
], false));
|
|
210
|
+
return [4 /*yield*/, command.execute()];
|
|
211
|
+
case 1:
|
|
212
|
+
_a.sent();
|
|
213
|
+
expect(processModule.processLogCheck.mock.calls[0][0].config
|
|
214
|
+
.ignoreCodes).toEqual(['22-322']);
|
|
215
|
+
return [2 /*return*/];
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}); });
|
|
219
|
+
it('renders the human report by default', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
220
|
+
var command;
|
|
221
|
+
return __generator(this, function (_a) {
|
|
222
|
+
switch (_a.label) {
|
|
223
|
+
case 0:
|
|
224
|
+
command = new logcheckCommand_1.LogCheckCommand(__spreadArray(__spreadArray([], __read(defaultArgs), false), ['a.log'], false));
|
|
225
|
+
return [4 /*yield*/, command.execute()];
|
|
226
|
+
case 1:
|
|
227
|
+
_a.sent();
|
|
228
|
+
expect(renderModule.renderLogCheck).toHaveBeenCalledWith(expect.anything(), expect.anything(), { format: 'human', verbose: false });
|
|
229
|
+
return [2 /*return*/];
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}); });
|
|
233
|
+
it('renders JSON when the shorthand flag is used', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
234
|
+
var command;
|
|
235
|
+
return __generator(this, function (_a) {
|
|
236
|
+
switch (_a.label) {
|
|
237
|
+
case 0:
|
|
238
|
+
command = new logcheckCommand_1.LogCheckCommand(__spreadArray(__spreadArray([], __read(defaultArgs), false), ['--json'], false));
|
|
239
|
+
return [4 /*yield*/, command.execute()];
|
|
240
|
+
case 1:
|
|
241
|
+
_a.sent();
|
|
242
|
+
expect(renderModule.renderLogCheck).toHaveBeenCalledWith(expect.anything(), expect.anything(), { format: 'json', verbose: false });
|
|
243
|
+
return [2 /*return*/];
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}); });
|
|
247
|
+
it('passes the verbose flag on to the report', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
248
|
+
var command;
|
|
249
|
+
return __generator(this, function (_a) {
|
|
250
|
+
switch (_a.label) {
|
|
251
|
+
case 0:
|
|
252
|
+
command = new logcheckCommand_1.LogCheckCommand(__spreadArray(__spreadArray([], __read(defaultArgs), false), ['--verbose'], false));
|
|
253
|
+
return [4 /*yield*/, command.execute()];
|
|
254
|
+
case 1:
|
|
255
|
+
_a.sent();
|
|
256
|
+
expect(renderModule.renderLogCheck).toHaveBeenCalledWith(expect.anything(), expect.anything(), { format: 'human', verbose: true });
|
|
257
|
+
return [2 /*return*/];
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}); });
|
|
261
|
+
it('returns success when the summary carries no failure', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
262
|
+
var command, _a;
|
|
263
|
+
return __generator(this, function (_b) {
|
|
264
|
+
switch (_b.label) {
|
|
265
|
+
case 0:
|
|
266
|
+
command = new logcheckCommand_1.LogCheckCommand(defaultArgs);
|
|
267
|
+
_a = expect;
|
|
268
|
+
return [4 /*yield*/, command.execute()];
|
|
269
|
+
case 1:
|
|
270
|
+
_a.apply(void 0, [_b.sent()]).toEqual(command_1.ReturnCode.Success);
|
|
271
|
+
return [2 /*return*/];
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}); });
|
|
275
|
+
it('returns the logcheck code when the summary failed', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
276
|
+
var command, _a;
|
|
277
|
+
return __generator(this, function (_b) {
|
|
278
|
+
switch (_b.label) {
|
|
279
|
+
case 0:
|
|
280
|
+
jest
|
|
281
|
+
.spyOn(processModule, 'processLogCheck')
|
|
282
|
+
.mockImplementation(function () {
|
|
283
|
+
return Promise.resolve(summary({ failure: '2 errors' }));
|
|
284
|
+
});
|
|
285
|
+
command = new logcheckCommand_1.LogCheckCommand(defaultArgs);
|
|
286
|
+
_a = expect;
|
|
287
|
+
return [4 /*yield*/, command.execute()];
|
|
288
|
+
case 1:
|
|
289
|
+
_a.apply(void 0, [_b.sent()]).toEqual(command_1.ReturnCode.LogCheckError);
|
|
290
|
+
return [2 /*return*/];
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
}); });
|
|
294
|
+
it('refuses a failOn that is not a policy', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
295
|
+
var command, _a;
|
|
296
|
+
return __generator(this, function (_b) {
|
|
297
|
+
switch (_b.label) {
|
|
298
|
+
case 0:
|
|
299
|
+
command = new logcheckCommand_1.LogCheckCommand(__spreadArray(__spreadArray([], __read(defaultArgs), false), ['--fail-on', 'loud'], false));
|
|
300
|
+
_a = expect;
|
|
301
|
+
return [4 /*yield*/, command.execute()];
|
|
302
|
+
case 1:
|
|
303
|
+
_a.apply(void 0, [_b.sent()]).toEqual(command_1.ReturnCode.InvalidCommand);
|
|
304
|
+
expect(process.logger.error).toHaveBeenCalled();
|
|
305
|
+
expect(processModule.processLogCheck).not.toHaveBeenCalled();
|
|
306
|
+
return [2 /*return*/];
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}); });
|
|
310
|
+
it('refuses a format that is not one of the three', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
311
|
+
var command, _a;
|
|
312
|
+
return __generator(this, function (_b) {
|
|
313
|
+
switch (_b.label) {
|
|
314
|
+
case 0:
|
|
315
|
+
command = new logcheckCommand_1.LogCheckCommand(__spreadArray(__spreadArray([], __read(defaultArgs), false), ['--format', 'xml'], false));
|
|
316
|
+
_a = expect;
|
|
317
|
+
return [4 /*yield*/, command.execute()];
|
|
318
|
+
case 1:
|
|
319
|
+
_a.apply(void 0, [_b.sent()]).toEqual(command_1.ReturnCode.InvalidCommand);
|
|
320
|
+
expect(processModule.processLogCheck).not.toHaveBeenCalled();
|
|
321
|
+
return [2 /*return*/];
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
}); });
|
|
325
|
+
it('reports a broken config as an internal error', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
326
|
+
var command, _a;
|
|
327
|
+
return __generator(this, function (_b) {
|
|
328
|
+
switch (_b.label) {
|
|
329
|
+
case 0:
|
|
330
|
+
jest
|
|
331
|
+
.spyOn(configModule, 'readLogCheckConfig')
|
|
332
|
+
.mockImplementation(function () { return Promise.reject(new Error('bad config')); });
|
|
333
|
+
command = new logcheckCommand_1.LogCheckCommand(defaultArgs);
|
|
334
|
+
_a = expect;
|
|
335
|
+
return [4 /*yield*/, command.execute()];
|
|
336
|
+
case 1:
|
|
337
|
+
_a.apply(void 0, [_b.sent()]).toEqual(command_1.ReturnCode.InternalError);
|
|
338
|
+
expect(process.logger.error).toHaveBeenCalled();
|
|
339
|
+
return [2 /*return*/];
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}); });
|
|
343
|
+
it('reports a scan that threw as an internal error', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
344
|
+
var command, _a;
|
|
345
|
+
return __generator(this, function (_b) {
|
|
346
|
+
switch (_b.label) {
|
|
347
|
+
case 0:
|
|
348
|
+
jest
|
|
349
|
+
.spyOn(processModule, 'processLogCheck')
|
|
350
|
+
.mockImplementation(function () { return Promise.reject(new Error('boom')); });
|
|
351
|
+
command = new logcheckCommand_1.LogCheckCommand(defaultArgs);
|
|
352
|
+
_a = expect;
|
|
353
|
+
return [4 /*yield*/, command.execute()];
|
|
354
|
+
case 1:
|
|
355
|
+
_a.apply(void 0, [_b.sent()]).toEqual(command_1.ReturnCode.InternalError);
|
|
356
|
+
return [2 /*return*/];
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
}); });
|
|
360
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|