@itentialopensource/adapter-robustel 0.1.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.
Files changed (53) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +18 -0
  3. package/.jshintrc +3 -0
  4. package/CHANGELOG.md +9 -0
  5. package/CODE_OF_CONDUCT.md +48 -0
  6. package/CONTRIBUTING.md +158 -0
  7. package/LICENSE +201 -0
  8. package/README.md +687 -0
  9. package/adapter.js +1660 -0
  10. package/adapterBase.js +1028 -0
  11. package/entities/.generic/action.json +109 -0
  12. package/entities/.generic/schema.json +23 -0
  13. package/entities/.system/action.json +50 -0
  14. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  15. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  16. package/entities/.system/schema.json +19 -0
  17. package/entities/.system/schemaTokenReq.json +53 -0
  18. package/entities/.system/schemaTokenResp.json +53 -0
  19. package/entities/Dashboard/action.json +46 -0
  20. package/entities/Dashboard/schema.json +20 -0
  21. package/entities/Device/action.json +87 -0
  22. package/entities/Device/schema.json +22 -0
  23. package/error.json +184 -0
  24. package/package.json +84 -0
  25. package/pronghorn.json +774 -0
  26. package/propertiesSchema.json +840 -0
  27. package/refs?service=git-upload-pack +0 -0
  28. package/report/Robustel.swagger-converted (3).json +204 -0
  29. package/report/creationReport.json +214 -0
  30. package/report/updateReport1645453224836.json +95 -0
  31. package/sampleProperties.json +106 -0
  32. package/test/integration/adapterTestBasicGet.js +85 -0
  33. package/test/integration/adapterTestConnectivity.js +93 -0
  34. package/test/integration/adapterTestIntegration.js +629 -0
  35. package/test/unit/adapterBaseTestUnit.js +944 -0
  36. package/test/unit/adapterTestUnit.js +1526 -0
  37. package/utils/addAuth.js +94 -0
  38. package/utils/artifactize.js +146 -0
  39. package/utils/basicGet.js +50 -0
  40. package/utils/checkMigrate.js +63 -0
  41. package/utils/entitiesToDB.js +224 -0
  42. package/utils/findPath.js +74 -0
  43. package/utils/modify.js +154 -0
  44. package/utils/packModificationScript.js +35 -0
  45. package/utils/patches2bundledDeps.js +90 -0
  46. package/utils/pre-commit.sh +27 -0
  47. package/utils/removeHooks.js +20 -0
  48. package/utils/setup.js +33 -0
  49. package/utils/tbScript.js +169 -0
  50. package/utils/tbUtils.js +451 -0
  51. package/utils/testRunner.js +298 -0
  52. package/utils/troubleshootingAdapter.js +190 -0
  53. package/workflows/README.md +3 -0
@@ -0,0 +1,629 @@
1
+ /* @copyright Itential, LLC 2019 (pre-modifications) */
2
+
3
+ // Set globals
4
+ /* global describe it log pronghornProps */
5
+ /* eslint no-unused-vars: warn */
6
+
7
+ // include required items for testing & logging
8
+ const assert = require('assert');
9
+ const fs = require('fs');
10
+ const mocha = require('mocha');
11
+ const path = require('path');
12
+ const winston = require('winston');
13
+ const { expect } = require('chai');
14
+ const { use } = require('chai');
15
+ const td = require('testdouble');
16
+ const util = require('util');
17
+ const pronghorn = require('../../pronghorn.json');
18
+
19
+ pronghorn.methodsByName = pronghorn.methods.reduce((result, meth) => ({ ...result, [meth.name]: meth }), {});
20
+ const anything = td.matchers.anything();
21
+
22
+ // stub and attemptTimeout are used throughout the code so set them here
23
+ let logLevel = 'none';
24
+ const stub = true;
25
+ const isRapidFail = false;
26
+ const isSaveMockData = false;
27
+ const attemptTimeout = 5000;
28
+
29
+ // these variables can be changed to run in integrated mode so easier to set them here
30
+ // always check these in with bogus data!!!
31
+ const host = 'replace.hostorip.here';
32
+ const username = 'username';
33
+ const password = 'password';
34
+ const protocol = 'http';
35
+ const port = 80;
36
+ const sslenable = false;
37
+ const sslinvalid = false;
38
+
39
+ // these are the adapter properties. You generally should not need to alter
40
+ // any of these after they are initially set up
41
+ global.pronghornProps = {
42
+ pathProps: {
43
+ encrypted: false
44
+ },
45
+ adapterProps: {
46
+ adapters: [{
47
+ id: 'Test-robustel',
48
+ type: 'Robustel',
49
+ properties: {
50
+ host,
51
+ port,
52
+ base_path: '/api/link',
53
+ version: '',
54
+ cache_location: 'none',
55
+ encode_pathvars: true,
56
+ save_metric: false,
57
+ stub,
58
+ protocol,
59
+ authentication: {
60
+ auth_method: 'no_authentication',
61
+ username,
62
+ password,
63
+ token: '',
64
+ invalid_token_error: 401,
65
+ token_timeout: -1,
66
+ token_cache: 'local',
67
+ auth_field: 'header.headers.Authorization',
68
+ auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
69
+ auth_logging: false,
70
+ client_id: 'client_id',
71
+ client_secret: 'client_secret',
72
+ grant_type: '',
73
+ api_version: '1.0',
74
+ signature_version: '1.0',
75
+ unique_code: 'unique_code'
76
+ },
77
+ healthcheck: {
78
+ type: 'none',
79
+ frequency: 60000,
80
+ query_object: {}
81
+ },
82
+ throttle: {
83
+ throttle_enabled: false,
84
+ number_pronghorns: 1,
85
+ sync_async: 'sync',
86
+ max_in_queue: 1000,
87
+ concurrent_max: 1,
88
+ expire_timeout: 0,
89
+ avg_runtime: 200,
90
+ priorities: [
91
+ {
92
+ value: 0,
93
+ percent: 100
94
+ }
95
+ ]
96
+ },
97
+ request: {
98
+ number_redirects: 0,
99
+ number_retries: 3,
100
+ limit_retry_error: [0],
101
+ failover_codes: [],
102
+ attempt_timeout: attemptTimeout,
103
+ global_request: {
104
+ payload: {},
105
+ uriOptions: {},
106
+ addlHeaders: {},
107
+ authData: {}
108
+ },
109
+ healthcheck_on_timeout: true,
110
+ return_raw: true,
111
+ archiving: false,
112
+ return_request: false
113
+ },
114
+ proxy: {
115
+ enabled: false,
116
+ host: '',
117
+ port: 1,
118
+ protocol: 'http',
119
+ username: '',
120
+ password: ''
121
+ },
122
+ ssl: {
123
+ ecdhCurve: '',
124
+ enabled: sslenable,
125
+ accept_invalid_cert: sslinvalid,
126
+ ca_file: '',
127
+ key_file: '',
128
+ cert_file: '',
129
+ secure_protocol: '',
130
+ ciphers: ''
131
+ },
132
+ mongo: {
133
+ host: '',
134
+ port: 0,
135
+ database: '',
136
+ username: '',
137
+ password: '',
138
+ replSet: '',
139
+ db_ssl: {
140
+ enabled: false,
141
+ accept_invalid_cert: false,
142
+ ca_file: '',
143
+ key_file: '',
144
+ cert_file: ''
145
+ }
146
+ }
147
+ }
148
+ }]
149
+ }
150
+ };
151
+
152
+ global.$HOME = `${__dirname}/../..`;
153
+
154
+ // set the log levels that Pronghorn uses, spam and trace are not defaulted in so without
155
+ // this you may error on log.trace calls.
156
+ const myCustomLevels = {
157
+ levels: {
158
+ spam: 6,
159
+ trace: 5,
160
+ debug: 4,
161
+ info: 3,
162
+ warn: 2,
163
+ error: 1,
164
+ none: 0
165
+ }
166
+ };
167
+
168
+ // need to see if there is a log level passed in
169
+ process.argv.forEach((val) => {
170
+ // is there a log level defined to be passed in?
171
+ if (val.indexOf('--LOG') === 0) {
172
+ // get the desired log level
173
+ const inputVal = val.split('=')[1];
174
+
175
+ // validate the log level is supported, if so set it
176
+ if (Object.hasOwnProperty.call(myCustomLevels.levels, inputVal)) {
177
+ logLevel = inputVal;
178
+ }
179
+ }
180
+ });
181
+
182
+ // need to set global logging
183
+ global.log = winston.createLogger({
184
+ level: logLevel,
185
+ levels: myCustomLevels.levels,
186
+ transports: [
187
+ new winston.transports.Console()
188
+ ]
189
+ });
190
+
191
+ /**
192
+ * Runs the common asserts for test
193
+ */
194
+ function runCommonAsserts(data, error) {
195
+ assert.equal(undefined, error);
196
+ assert.notEqual(undefined, data);
197
+ assert.notEqual(null, data);
198
+ assert.notEqual(undefined, data.response);
199
+ assert.notEqual(null, data.response);
200
+ }
201
+
202
+ /**
203
+ * Runs the error asserts for the test
204
+ */
205
+ function runErrorAsserts(data, error, code, origin, displayStr) {
206
+ assert.equal(null, data);
207
+ assert.notEqual(undefined, error);
208
+ assert.notEqual(null, error);
209
+ assert.notEqual(undefined, error.IAPerror);
210
+ assert.notEqual(null, error.IAPerror);
211
+ assert.notEqual(undefined, error.IAPerror.displayString);
212
+ assert.notEqual(null, error.IAPerror.displayString);
213
+ assert.equal(code, error.icode);
214
+ assert.equal(origin, error.IAPerror.origin);
215
+ assert.equal(displayStr, error.IAPerror.displayString);
216
+ }
217
+
218
+ /**
219
+ * @function saveMockData
220
+ * Attempts to take data from responses and place them in MockDataFiles to help create Mockdata.
221
+ * Note, this was built based on entity file structure for Adapter-Engine 1.6.x
222
+ * @param {string} entityName - Name of the entity saving mock data for
223
+ * @param {string} actionName - Name of the action saving mock data for
224
+ * @param {string} descriptor - Something to describe this test (used as a type)
225
+ * @param {string or object} responseData - The data to put in the mock file.
226
+ */
227
+ function saveMockData(entityName, actionName, descriptor, responseData) {
228
+ // do not need to save mockdata if we are running in stub mode (already has mock data) or if told not to save
229
+ if (stub || !isSaveMockData) {
230
+ return false;
231
+ }
232
+
233
+ // must have a response in order to store the response
234
+ if (responseData && responseData.response) {
235
+ let data = responseData.response;
236
+
237
+ // if there was a raw response that one is better as it is untranslated
238
+ if (responseData.raw) {
239
+ data = responseData.raw;
240
+
241
+ try {
242
+ const temp = JSON.parse(data);
243
+ data = temp;
244
+ } catch (pex) {
245
+ // do not care if it did not parse as we will just use data
246
+ }
247
+ }
248
+
249
+ try {
250
+ const base = path.join(__dirname, `../../entities/${entityName}/`);
251
+ const mockdatafolder = 'mockdatafiles';
252
+ const filename = `mockdatafiles/${actionName}-${descriptor}.json`;
253
+
254
+ if (!fs.existsSync(base + mockdatafolder)) {
255
+ fs.mkdirSync(base + mockdatafolder);
256
+ }
257
+
258
+ // write the data we retrieved
259
+ fs.writeFile(base + filename, JSON.stringify(data, null, 2), 'utf8', (errWritingMock) => {
260
+ if (errWritingMock) throw errWritingMock;
261
+
262
+ // update the action file to reflect the changes. Note: We're replacing the default object for now!
263
+ fs.readFile(`${base}action.json`, (errRead, content) => {
264
+ if (errRead) throw errRead;
265
+
266
+ // parse the action file into JSON
267
+ const parsedJson = JSON.parse(content);
268
+
269
+ // The object update we'll write in.
270
+ const responseObj = {
271
+ type: descriptor,
272
+ key: '',
273
+ mockFile: filename
274
+ };
275
+
276
+ // get the object for method we're trying to change.
277
+ const currentMethodAction = parsedJson.actions.find((obj) => obj.name === actionName);
278
+
279
+ // if the method was not found - should never happen but...
280
+ if (!currentMethodAction) {
281
+ throw Error('Can\'t find an action for this method in the provided entity.');
282
+ }
283
+
284
+ // if there is a response object, we want to replace the Response object. Otherwise we'll create one.
285
+ const actionResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === descriptor);
286
+
287
+ // Add the action responseObj back into the array of response objects.
288
+ if (!actionResponseObj) {
289
+ // if there is a default response object, we want to get the key.
290
+ const defaultResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === 'default');
291
+
292
+ // save the default key into the new response object
293
+ if (defaultResponseObj) {
294
+ responseObj.key = defaultResponseObj.key;
295
+ }
296
+
297
+ // save the new response object
298
+ currentMethodAction.responseObjects = [responseObj];
299
+ } else {
300
+ // update the location of the mock data file
301
+ actionResponseObj.mockFile = responseObj.mockFile;
302
+ }
303
+
304
+ // Save results
305
+ fs.writeFile(`${base}action.json`, JSON.stringify(parsedJson, null, 2), (err) => {
306
+ if (err) throw err;
307
+ });
308
+ });
309
+ });
310
+ } catch (e) {
311
+ log.debug(`Failed to save mock data for ${actionName}. ${e.message}`);
312
+ return false;
313
+ }
314
+ }
315
+
316
+ // no response to save
317
+ log.debug(`No data passed to save into mockdata for ${actionName}`);
318
+ return false;
319
+ }
320
+
321
+ // require the adapter that we are going to be using
322
+ const Robustel = require('../../adapter');
323
+
324
+ // begin the testing - these should be pretty well defined between the describe and the it!
325
+ describe('[integration] Robustel Adapter Test', () => {
326
+ describe('Robustel Class Tests', () => {
327
+ const a = new Robustel(
328
+ pronghornProps.adapterProps.adapters[0].id,
329
+ pronghornProps.adapterProps.adapters[0].properties
330
+ );
331
+
332
+ if (isRapidFail) {
333
+ const state = {};
334
+ state.passed = true;
335
+
336
+ mocha.afterEach(function x() {
337
+ state.passed = state.passed
338
+ && (this.currentTest.state === 'passed');
339
+ });
340
+ mocha.beforeEach(function x() {
341
+ if (!state.passed) {
342
+ return this.currentTest.skip();
343
+ }
344
+ return true;
345
+ });
346
+ }
347
+
348
+ describe('#class instance created', () => {
349
+ it('should be a class with properties', (done) => {
350
+ try {
351
+ assert.notEqual(null, a);
352
+ assert.notEqual(undefined, a);
353
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
354
+ assert.equal(checkId, a.id);
355
+ assert.notEqual(null, a.allProps);
356
+ const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
357
+ assert.equal(check, a.healthcheckType);
358
+ done();
359
+ } catch (error) {
360
+ log.error(`Test Failure: ${error}`);
361
+ done(error);
362
+ }
363
+ }).timeout(attemptTimeout);
364
+ });
365
+
366
+ describe('#connect', () => {
367
+ it('should get connected - no healthcheck', (done) => {
368
+ try {
369
+ a.healthcheckType = 'none';
370
+ a.connect();
371
+
372
+ try {
373
+ assert.equal(true, a.alive);
374
+ done();
375
+ } catch (error) {
376
+ log.error(`Test Failure: ${error}`);
377
+ done(error);
378
+ }
379
+ } catch (error) {
380
+ log.error(`Adapter Exception: ${error}`);
381
+ done(error);
382
+ }
383
+ });
384
+ it('should get connected - startup healthcheck', (done) => {
385
+ try {
386
+ a.healthcheckType = 'startup';
387
+ a.connect();
388
+
389
+ try {
390
+ assert.equal(true, a.alive);
391
+ done();
392
+ } catch (error) {
393
+ log.error(`Test Failure: ${error}`);
394
+ done(error);
395
+ }
396
+ } catch (error) {
397
+ log.error(`Adapter Exception: ${error}`);
398
+ done(error);
399
+ }
400
+ });
401
+ });
402
+
403
+ describe('#healthCheck', () => {
404
+ it('should be healthy', (done) => {
405
+ try {
406
+ a.healthCheck(null, (data) => {
407
+ try {
408
+ assert.equal(true, a.healthy);
409
+ saveMockData('system', 'healthcheck', 'default', data);
410
+ done();
411
+ } catch (err) {
412
+ log.error(`Test Failure: ${err}`);
413
+ done(err);
414
+ }
415
+ });
416
+ } catch (error) {
417
+ log.error(`Adapter Exception: ${error}`);
418
+ done(error);
419
+ }
420
+ }).timeout(attemptTimeout);
421
+ });
422
+
423
+ /*
424
+ -----------------------------------------------------------------------
425
+ -----------------------------------------------------------------------
426
+ *** All code above this comment will be replaced during a migration ***
427
+ ******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
428
+ -----------------------------------------------------------------------
429
+ -----------------------------------------------------------------------
430
+ */
431
+ let skipCount = 0;
432
+
433
+ describe('#getDeviceTotal - errors', () => {
434
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
435
+ if (pronghorn.methodsByName.getDeviceTotal.task) {
436
+ try {
437
+ a.getDeviceTotal((data, error) => {
438
+ try {
439
+ if (stub) {
440
+ const displayE = 'Error 400 received on request';
441
+ runErrorAsserts(data, error, 'AD.500', 'Test-robustel-connectorRest-handleEndResponse', displayE);
442
+ } else {
443
+ runCommonAsserts(data, error);
444
+ }
445
+ saveMockData('Dashboard', 'getDeviceTotal', 'default', data);
446
+ done();
447
+ } catch (err) {
448
+ log.error(`Test Failure: ${err}`);
449
+ done(err);
450
+ }
451
+ });
452
+ } catch (error) {
453
+ log.error(`Adapter Exception: ${error}`);
454
+ done(error);
455
+ }
456
+ } else {
457
+ log.error('getDeviceTotal task is false, skipping test');
458
+ skipCount += 1;
459
+ done();
460
+ }// end if task
461
+ }).timeout(attemptTimeout);
462
+ });
463
+
464
+ describe('#getNetworkTotal - errors', () => {
465
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
466
+ if (pronghorn.methodsByName.getNetworkTotal.task) {
467
+ try {
468
+ a.getNetworkTotal((data, error) => {
469
+ try {
470
+ if (stub) {
471
+ const displayE = 'Error 400 received on request';
472
+ runErrorAsserts(data, error, 'AD.500', 'Test-robustel-connectorRest-handleEndResponse', displayE);
473
+ } else {
474
+ runCommonAsserts(data, error);
475
+ }
476
+ saveMockData('Dashboard', 'getNetworkTotal', 'default', data);
477
+ done();
478
+ } catch (err) {
479
+ log.error(`Test Failure: ${err}`);
480
+ done(err);
481
+ }
482
+ });
483
+ } catch (error) {
484
+ log.error(`Adapter Exception: ${error}`);
485
+ done(error);
486
+ }
487
+ } else {
488
+ log.error('getNetworkTotal task is false, skipping test');
489
+ skipCount += 1;
490
+ done();
491
+ }// end if task
492
+ }).timeout(attemptTimeout);
493
+ });
494
+
495
+ const deviceCommandId = 'fakedata';
496
+ describe('#getFirmwareUpdateResult - errors', () => {
497
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
498
+ if (pronghorn.methodsByName.getFirmwareUpdateResult.task) {
499
+ try {
500
+ a.getFirmwareUpdateResult(deviceCommandId, (data, error) => {
501
+ try {
502
+ if (stub) {
503
+ const displayE = 'Error 400 received on request';
504
+ runErrorAsserts(data, error, 'AD.500', 'Test-robustel-connectorRest-handleEndResponse', displayE);
505
+ } else {
506
+ runCommonAsserts(data, error);
507
+ }
508
+ saveMockData('Device', 'getFirmwareUpdateResult', 'default', data);
509
+ done();
510
+ } catch (err) {
511
+ log.error(`Test Failure: ${err}`);
512
+ done(err);
513
+ }
514
+ });
515
+ } catch (error) {
516
+ log.error(`Adapter Exception: ${error}`);
517
+ done(error);
518
+ }
519
+ } else {
520
+ log.error('getFirmwareUpdateResult task is false, skipping test');
521
+ skipCount += 1;
522
+ done();
523
+ }// end if task
524
+ }).timeout(attemptTimeout);
525
+ });
526
+
527
+ const deviceSerialNumber = 'fakedata';
528
+ describe('#getDeviceDetails - errors', () => {
529
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
530
+ if (pronghorn.methodsByName.getDeviceDetails.task) {
531
+ try {
532
+ a.getDeviceDetails(deviceSerialNumber, (data, error) => {
533
+ try {
534
+ if (stub) {
535
+ const displayE = 'Error 400 received on request';
536
+ runErrorAsserts(data, error, 'AD.500', 'Test-robustel-connectorRest-handleEndResponse', displayE);
537
+ } else {
538
+ runCommonAsserts(data, error);
539
+ }
540
+ saveMockData('Device', 'getDeviceDetails', 'default', data);
541
+ done();
542
+ } catch (err) {
543
+ log.error(`Test Failure: ${err}`);
544
+ done(err);
545
+ }
546
+ });
547
+ } catch (error) {
548
+ log.error(`Adapter Exception: ${error}`);
549
+ done(error);
550
+ }
551
+ } else {
552
+ log.error('getDeviceDetails task is false, skipping test');
553
+ skipCount += 1;
554
+ done();
555
+ }// end if task
556
+ }).timeout(attemptTimeout);
557
+ });
558
+
559
+ const deviceRunCommandOnDeviceBodyParam = {};
560
+ describe('#runCommandOnDevice - errors', () => {
561
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
562
+ if (pronghorn.methodsByName.runCommandOnDevice.task) {
563
+ try {
564
+ a.runCommandOnDevice(deviceSerialNumber, deviceRunCommandOnDeviceBodyParam, (data, error) => {
565
+ try {
566
+ if (stub) {
567
+ const displayE = 'Error 400 received on request';
568
+ runErrorAsserts(data, error, 'AD.500', 'Test-robustel-connectorRest-handleEndResponse', displayE);
569
+ } else {
570
+ runCommonAsserts(data, error);
571
+ }
572
+ saveMockData('Device', 'runCommandOnDevice', 'default', data);
573
+ done();
574
+ } catch (err) {
575
+ log.error(`Test Failure: ${err}`);
576
+ done(err);
577
+ }
578
+ });
579
+ } catch (error) {
580
+ log.error(`Adapter Exception: ${error}`);
581
+ done(error);
582
+ }
583
+ } else {
584
+ log.error('runCommandOnDevice task is false, skipping test');
585
+ skipCount += 1;
586
+ done();
587
+ }// end if task
588
+ }).timeout(attemptTimeout);
589
+ });
590
+
591
+ describe('#getDeviceFirmwareList - errors', () => {
592
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
593
+ if (pronghorn.methodsByName.getDeviceFirmwareList.task) {
594
+ try {
595
+ a.getDeviceFirmwareList(deviceSerialNumber, (data, error) => {
596
+ try {
597
+ if (stub) {
598
+ const displayE = 'Error 400 received on request';
599
+ runErrorAsserts(data, error, 'AD.500', 'Test-robustel-connectorRest-handleEndResponse', displayE);
600
+ } else {
601
+ runCommonAsserts(data, error);
602
+ }
603
+ saveMockData('Device', 'getDeviceFirmwareList', 'default', data);
604
+ done();
605
+ } catch (err) {
606
+ log.error(`Test Failure: ${err}`);
607
+ done(err);
608
+ }
609
+ });
610
+ } catch (error) {
611
+ log.error(`Adapter Exception: ${error}`);
612
+ done(error);
613
+ }
614
+ } else {
615
+ log.error('getDeviceFirmwareList task is false, skipping test');
616
+ skipCount += 1;
617
+ done();
618
+ }// end if task
619
+ }).timeout(attemptTimeout);
620
+ });
621
+
622
+ describe('#Skipped test count', () => {
623
+ it('count skipped tests', (done) => {
624
+ console.log(`skipped ${skipCount} tests because \x1b[33mtask: false\x1b[0m`);
625
+ done();
626
+ });
627
+ });
628
+ });
629
+ });