@sasjs/cli 3.7.0 → 3.7.7
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/CHANGELOG.md +30 -0
- package/README.md +9 -11
- package/build/commands/build/build.js +19 -34
- package/build/commands/deploy/deploy.js +2 -4
- package/build/commands/testing/spec/testing.spec.server.js +19 -60
- package/build/commands/testing/test.d.ts +1 -2
- package/build/commands/testing/test.js +102 -130
- package/package.json +4 -7
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
Since March 7th, 2020, the changelog is managed by github releases. See [https://github.com/sasjs/cli/releases](https://github.com/sasjs/cli/releases).
|
|
4
|
+
|
|
5
|
+
## Changes Prior to March 7th 2020
|
|
6
|
+
|
|
7
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
8
|
+
|
|
9
|
+
<a name="1.0.4"></a>
|
|
10
|
+
## [1.0.4](https://gitlab.com/macropeople/sasjs-cli/compare/v1.0.3...v1.0.4) (2020-03-07)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* redo comment stripping logic ([84a1a91](https://gitlab.com/macropeople/sasjs-cli/commit/84a1a91))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
<a name="1.0.3"></a>
|
|
20
|
+
## [1.0.3](https://gitlab.com/macropeople/sasjs-cli/compare/v1.0.2...v1.0.3) (2020-03-07)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<a name="1.0.2"></a>
|
|
25
|
+
## [1.0.2](https://gitlab.com/macropeople/sasjs-cli/compare/v1.0.1...v1.0.2) (2020-03-07)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
<a name="1.0.1"></a>
|
|
30
|
+
## 1.0.1 (2020-03-07)
|
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# SASjs CLI
|
|
2
|
+
|
|
2
3
|
[![npm package][npm-image]][npm-url]
|
|
3
4
|
[![Github Workflow][githubworkflow-image]][githubworkflow-url]
|
|
4
5
|
[]()
|
|
@@ -9,15 +10,14 @@
|
|
|
9
10
|
[](https://github.com/sasjs/cli/issues)
|
|
10
11
|
[](https://gitpod.io/#https://github.com/sasjs/cli)
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
[npm-
|
|
14
|
-
[
|
|
15
|
-
[githubworkflow-
|
|
16
|
-
[githubworkflow-url]:https://github.com/sasjs/cli/blob/main/.github/workflows/run-tests.yml
|
|
13
|
+
[npm-image]: https://img.shields.io/npm/v/@sasjs/cli.svg
|
|
14
|
+
[npm-url]: http://npmjs.org/package/@sasjs/cli
|
|
15
|
+
[githubworkflow-image]: https://github.com/sasjs/cli/actions/workflows/run-tests.yml/badge.svg
|
|
16
|
+
[githubworkflow-url]: https://github.com/sasjs/cli/blob/main/.github/workflows/run-tests.yml
|
|
17
17
|
|
|
18
18
|
`@sasjs/cli` is a Command-Line Interface to assist with creating, building, and deploying Data Science projects and HTML5 Web Applications on the SAS platform (both SAS 9 and Viya). Features include:
|
|
19
19
|
|
|
20
|
-
- Scaffold a new SAS App in seconds
|
|
20
|
+
- Scaffold a new SAS App in seconds (`sasjs create myApp -t jobs`)
|
|
21
21
|
- Compile / Build SAS Jobs, Services & Macros _locally_ and deploy / execute _remotely_, in isolation from other developers (`sasjs cbd`)
|
|
22
22
|
- No dependency on the server filesystem
|
|
23
23
|
- Trigger Viya Jobs & Flows (`sasjs job execute` / `sasjs flow execute`)
|
|
@@ -40,19 +40,18 @@ A quick demonstration of using it to compile, build and deploy a set of SAS Viya
|
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
You can also use the tool without deploying through NPX as follows:
|
|
43
|
+
|
|
43
44
|
```
|
|
44
45
|
npx @sasjs/cli <command>
|
|
45
46
|
```
|
|
46
47
|
|
|
47
48
|
## Documentation
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
Additional documentation can be found on the [SASjs CLI documentation](https://cli.sasjs.io) site.
|
|
51
|
-
|
|
50
|
+
Additional documentation can be found on the [SASjs CLI documentation](https://cli.sasjs.io) site.
|
|
52
51
|
|
|
53
52
|
## Notes
|
|
54
53
|
|
|
55
|
-
Running `npm i -g @sasjs/cli@latest` does not always upgrade properly.
|
|
54
|
+
Running `npm i -g @sasjs/cli@latest` does not always upgrade properly. This is due to a known bug in npm, which is fixed in npm 7.
|
|
56
55
|
|
|
57
56
|
If you are running NPM in version 6 or below, you can try running `npm update -g @sasjs/cli` instead, or - the sledgehammer approach - delete the files from the NPM folder and then do a fresh install.
|
|
58
57
|
|
|
@@ -62,7 +61,6 @@ If you find this library useful, please leave a star and help us grow our star g
|
|
|
62
61
|
|
|
63
62
|

|
|
64
63
|
|
|
65
|
-
|
|
66
64
|
## Contributors ✨
|
|
67
65
|
|
|
68
66
|
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
@@ -294,23 +294,21 @@ function getCreateFileScript(serverType) {
|
|
|
294
294
|
});
|
|
295
295
|
});
|
|
296
296
|
}
|
|
297
|
-
function getWebServiceScriptInvocation(serverType,
|
|
298
|
-
if (filePath === void 0) { filePath = ''; }
|
|
297
|
+
function getWebServiceScriptInvocation(serverType, isSASFile, encoded) {
|
|
299
298
|
if (isSASFile === void 0) { isSASFile = true; }
|
|
300
299
|
if (encoded === void 0) { encoded = false; }
|
|
301
|
-
var loc = filePath === '' ? 'services' : 'tests';
|
|
302
300
|
var encodedParam = encoded ? ', intype=BASE64' : '';
|
|
303
301
|
switch (serverType) {
|
|
304
302
|
case utils_1.ServerType.SasViya:
|
|
305
303
|
return isSASFile
|
|
306
|
-
? "%mv_createwebservice(path=&appLoc
|
|
307
|
-
: "%mv_createfile(path=&appLoc
|
|
304
|
+
? "%mv_createwebservice(path=&appLoc/&path, name=&service, code=sascode ,replace=yes)"
|
|
305
|
+
: "%mv_createfile(path=&appLoc/&path, name=&filename, inref=filecode".concat(encodedParam, ")");
|
|
308
306
|
case utils_1.ServerType.Sas9:
|
|
309
|
-
return "%mm_createwebservice(path=&appLoc
|
|
307
|
+
return "%mm_createwebservice(path=&appLoc/&path, name=&service, code=sascode ,replace=yes)";
|
|
310
308
|
case utils_1.ServerType.Sasjs:
|
|
311
309
|
return isSASFile
|
|
312
|
-
? "%mv_createwebservice(path=&appLoc
|
|
313
|
-
: "%mv_createfile(path=&appLoc
|
|
310
|
+
? "%mv_createwebservice(path=&appLoc/&path, name=&service, code=sascode ,replace=yes)"
|
|
311
|
+
: "%mv_createfile(path=&appLoc/&path, name=&filename, inref=filecode".concat(encodedParam, ")");
|
|
314
312
|
default:
|
|
315
313
|
throw new error_1.ServerTypeError();
|
|
316
314
|
}
|
|
@@ -340,7 +338,7 @@ function getFolderContent(serverType) {
|
|
|
340
338
|
var _a, content, contentJSON;
|
|
341
339
|
return __generator(this, function (_b) {
|
|
342
340
|
switch (_b.label) {
|
|
343
|
-
case 0: return [4 /*yield*/, getContentFor(
|
|
341
|
+
case 0: return [4 /*yield*/, getContentFor(buildDestinationFolder, path_1.default.join(buildDestinationFolder, subFolder), serverType)];
|
|
344
342
|
case 1:
|
|
345
343
|
_a = _b.sent(), content = _a.content, contentJSON = _a.contentJSON;
|
|
346
344
|
folderContent += "\n".concat(content);
|
|
@@ -383,28 +381,19 @@ function getDependencies(filePaths) {
|
|
|
383
381
|
});
|
|
384
382
|
});
|
|
385
383
|
}
|
|
386
|
-
function getContentFor(rootDirectory, folderPath, serverType
|
|
387
|
-
if (testPath === void 0) { testPath = undefined; }
|
|
384
|
+
function getContentFor(rootDirectory, folderPath, serverType) {
|
|
388
385
|
return __awaiter(this, void 0, void 0, function () {
|
|
389
|
-
var folderName,
|
|
386
|
+
var folderName, content, contentJSON, files, subFolders;
|
|
390
387
|
var _this = this;
|
|
391
388
|
return __generator(this, function (_a) {
|
|
392
389
|
switch (_a.label) {
|
|
393
390
|
case 0:
|
|
394
391
|
folderName = path_1.default.basename(folderPath);
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
? ''
|
|
401
|
-
: testPath !== undefined
|
|
402
|
-
? testPath
|
|
403
|
-
: folderPath
|
|
404
|
-
.replace(rootDirectory, '')
|
|
405
|
-
.substr(1)
|
|
406
|
-
.split(path_1.default.sep)
|
|
407
|
-
.join('/'), ";\n");
|
|
392
|
+
content = "\n%let path=".concat(folderPath
|
|
393
|
+
.replace(rootDirectory, '')
|
|
394
|
+
.substr(1)
|
|
395
|
+
.split(path_1.default.sep)
|
|
396
|
+
.join('/'), ";\n");
|
|
408
397
|
contentJSON = {
|
|
409
398
|
name: folderName,
|
|
410
399
|
type: 'folder',
|
|
@@ -423,7 +412,7 @@ function getContentFor(rootDirectory, folderPath, serverType, testPath) {
|
|
|
423
412
|
return [4 /*yield*/, (0, utils_1.readFile)(filePath)];
|
|
424
413
|
case 1:
|
|
425
414
|
fileContent = _a.sent();
|
|
426
|
-
transformedContent = getServiceText(file, fileContent, serverType
|
|
415
|
+
transformedContent = getServiceText(file, fileContent, serverType);
|
|
427
416
|
content += "\n".concat(transformedContent, "\n");
|
|
428
417
|
contentJSON.members.push({
|
|
429
418
|
name: file.replace(/.sas$/, ''),
|
|
@@ -455,11 +444,7 @@ function getContentFor(rootDirectory, folderPath, serverType, testPath) {
|
|
|
455
444
|
var _a, childContent, childContentJSON;
|
|
456
445
|
return __generator(this, function (_b) {
|
|
457
446
|
switch (_b.label) {
|
|
458
|
-
case 0: return [4 /*yield*/, getContentFor(rootDirectory, path_1.default.join(folderPath, subFolder), serverType
|
|
459
|
-
? testPath === ''
|
|
460
|
-
? subFolder
|
|
461
|
-
: "".concat(testPath, "/").concat(subFolder)
|
|
462
|
-
: undefined)];
|
|
447
|
+
case 0: return [4 /*yield*/, getContentFor(rootDirectory, path_1.default.join(folderPath, subFolder), serverType)];
|
|
463
448
|
case 1:
|
|
464
449
|
_a = _b.sent(), childContent = _a.content, childContentJSON = _a.contentJSON;
|
|
465
450
|
contentJSON.members.push(childContentJSON);
|
|
@@ -475,7 +460,7 @@ function getContentFor(rootDirectory, folderPath, serverType, testPath) {
|
|
|
475
460
|
});
|
|
476
461
|
});
|
|
477
462
|
}
|
|
478
|
-
function getServiceText(serviceFileName, fileContent, serverType
|
|
463
|
+
function getServiceText(serviceFileName, fileContent, serverType) {
|
|
479
464
|
var serviceName = serviceFileName.replace(/.sas$/, '');
|
|
480
465
|
var sourceCodeLines = getLines((0, utils_2.removeComments)(fileContent));
|
|
481
466
|
var content = "";
|
|
@@ -486,14 +471,14 @@ function getServiceText(serviceFileName, fileContent, serverType, testPath) {
|
|
|
486
471
|
}
|
|
487
472
|
});
|
|
488
473
|
return "%let service=".concat(serviceName, ";\nfilename sascode temp lrecl=32767;\ndata _null_;\nfile sascode;\n").concat(content, "\n\nrun;\n").concat(serverType !== utils_1.ServerType.Sasjs
|
|
489
|
-
? getWebServiceScriptInvocation(serverType
|
|
474
|
+
? getWebServiceScriptInvocation(serverType)
|
|
490
475
|
: '', "\nfilename sascode clear;\n");
|
|
491
476
|
}
|
|
492
477
|
function getFileText(fileName, fileContent, serverType) {
|
|
493
478
|
var fileExtension = path_1.default.extname(fileName).substring(1).toUpperCase();
|
|
494
479
|
var _a = getWebFileContent(fileContent, fileExtension), content = _a.content, maxLineLength = _a.maxLineLength;
|
|
495
480
|
return "%let filename=".concat(fileName, ";\nfilename filecode temp lrecl=").concat(maxLineLength, ";\ndata _null_;\nfile filecode;\n").concat(content, "\n\nrun;\n").concat(serverType !== utils_1.ServerType.Sasjs
|
|
496
|
-
? getWebServiceScriptInvocation(serverType,
|
|
481
|
+
? getWebServiceScriptInvocation(serverType, false, true)
|
|
497
482
|
: '', "\nfilename filecode clear;\n");
|
|
498
483
|
}
|
|
499
484
|
function getWebFileContent(filecontent, type) {
|
|
@@ -90,7 +90,7 @@ function deploy(target, isLocal, sasjs) {
|
|
|
90
90
|
buildDestinationFolder = process.sasjsConstants.buildDestinationFolder;
|
|
91
91
|
logFilePath = buildDestinationFolder;
|
|
92
92
|
if (!(target.serverType === utils_2.ServerType.Sasjs)) return [3 /*break*/, 5];
|
|
93
|
-
return [4 /*yield*/, deployToSasjs(target,
|
|
93
|
+
return [4 /*yield*/, deployToSasjs(target, sasjs)];
|
|
94
94
|
case 4:
|
|
95
95
|
_k.sent();
|
|
96
96
|
return [3 /*break*/, 7];
|
|
@@ -323,11 +323,9 @@ function deployToSas9(deployScriptName, target, linesToExecute, logFolder, strea
|
|
|
323
323
|
/**
|
|
324
324
|
* Deploys app to `SASJS` server.
|
|
325
325
|
* @param {Target} target- the target having deploy configuration.
|
|
326
|
-
* @param {boolean} isLocal- flag indicating if specified target is
|
|
327
|
-
* from local sasjsconfig or global sasjsconfig file.
|
|
328
326
|
* @param {object} sasjs - optional configuration object of SAS adapter.
|
|
329
327
|
*/
|
|
330
|
-
function deployToSasjs(target,
|
|
328
|
+
function deployToSasjs(target, sasjs) {
|
|
331
329
|
var _a, _b;
|
|
332
330
|
return __awaiter(this, void 0, void 0, function () {
|
|
333
331
|
var buildDestinationFolder, finalFilePathJSON, jsonContent, payload, authConfig, e_2, result;
|
|
@@ -57,7 +57,6 @@ var test_2 = require("../../../utils/test");
|
|
|
57
57
|
var utils_2 = require("../../../utils");
|
|
58
58
|
var dotenv_1 = __importDefault(require("dotenv"));
|
|
59
59
|
var __1 = require("../..");
|
|
60
|
-
var node_1 = __importDefault(require("@sasjs/adapter/node"));
|
|
61
60
|
describe('sasjs test', function () {
|
|
62
61
|
var expectedCoverageLcov = "TN:testsetup.sas\nSF:standalone\nFNF:1\nFNH:1\nLF:1\nLH:1\nBRF:1\nBRH:1\nend_of_record\nTN:exampleprogram.test.sas\nSF:jobs/jobs/exampleprogram.sas\nFNF:1\nFNH:1\nLF:1\nLH:1\nBRF:1\nBRH:1\nend_of_record\nTN:standalone.test.sas\nSF:standalone\nFNF:1\nFNH:1\nLF:1\nLH:1\nBRF:1\nBRH:1\nend_of_record\nTN:examplemacro.test.sas\nSF:standalone\nFNF:1\nFNH:1\nLF:1\nLH:1\nBRF:1\nBRH:1\nend_of_record\nTN:shouldFail.test.sas\nSF:standalone\nFNF:1\nFNH:1\nLF:1\nLH:1\nBRF:1\nBRH:1\nend_of_record\nTN:dostuff.test.0.sas\nSF:services/admin/dostuff.sas\nFNF:1\nFNH:1\nLF:1\nLH:1\nBRF:1\nBRH:1\nend_of_record\nTN:dostuff.test.1.sas\nSF:services/admin/dostuff.sas\nFNF:1\nFNH:1\nLF:1\nLH:1\nBRF:1\nBRH:1\nend_of_record\nTN:testteardown.sas\nSF:standalone\nFNF:1\nFNH:1\nLF:1\nLH:1\nBRF:1\nBRH:1\nend_of_record";
|
|
63
62
|
describe('SASVIYA', function () {
|
|
@@ -367,9 +366,7 @@ describe('sasjs test', function () {
|
|
|
367
366
|
}); });
|
|
368
367
|
});
|
|
369
368
|
describe('SASJS', function () {
|
|
370
|
-
var sasjs = new node_1.default();
|
|
371
369
|
var target = generateTarget(utils_1.ServerType.Sasjs);
|
|
372
|
-
var t = "/Public/app/cli-tests/".concat(target.name, "/tests/").concat(test);
|
|
373
370
|
var testUrl = function (test) {
|
|
374
371
|
return "".concat((0, test_1.getTestUrl)(target, "/Public/app/cli-tests/".concat(target.name, "/tests/").concat(test)), "&_contextName=").concat(encodeURIComponent(target.contextName));
|
|
375
372
|
};
|
|
@@ -385,6 +382,9 @@ describe('sasjs test', function () {
|
|
|
385
382
|
_a.sent();
|
|
386
383
|
return [4 /*yield*/, (0, __1.build)(target)];
|
|
387
384
|
case 3:
|
|
385
|
+
_a.sent();
|
|
386
|
+
return [4 /*yield*/, (0, __1.deploy)(target, false)];
|
|
387
|
+
case 4:
|
|
388
388
|
_a.sent();
|
|
389
389
|
process.logger = new utils_1.Logger(utils_1.LogLevel.Off);
|
|
390
390
|
return [2 /*return*/];
|
|
@@ -402,12 +402,10 @@ describe('sasjs test', function () {
|
|
|
402
402
|
});
|
|
403
403
|
}); });
|
|
404
404
|
it('should execute tests and create result CSV, XML and JSON files using default source and output locations', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
405
|
-
var
|
|
405
|
+
var expectedResultsJson, expectedResultsCsv, resultsFolderPath, resultsJsonPath, resultsJson, resultsCsvPath, parsedResults, resultsCsv, resultsXmlPath, resultsXml, expectedResultsXml, coverageLcovPath, coverageLcov;
|
|
406
406
|
return __generator(this, function (_a) {
|
|
407
407
|
switch (_a.label) {
|
|
408
408
|
case 0:
|
|
409
|
-
testDescription = 'random test description';
|
|
410
|
-
testResult = 'PASS';
|
|
411
409
|
expectedResultsJson = {
|
|
412
410
|
sasjs_test_meta: [
|
|
413
411
|
{
|
|
@@ -416,12 +414,7 @@ describe('sasjs test', function () {
|
|
|
416
414
|
{
|
|
417
415
|
test_loc: 'tests/testsetup.sas',
|
|
418
416
|
sasjs_test_id: '',
|
|
419
|
-
result:
|
|
420
|
-
{
|
|
421
|
-
TEST_DESCRIPTION: testDescription,
|
|
422
|
-
TEST_RESULT: testResult
|
|
423
|
-
}
|
|
424
|
-
],
|
|
417
|
+
result: 'not provided',
|
|
425
418
|
test_url: testUrl('testsetup')
|
|
426
419
|
}
|
|
427
420
|
]
|
|
@@ -432,12 +425,7 @@ describe('sasjs test', function () {
|
|
|
432
425
|
{
|
|
433
426
|
test_loc: 'tests/jobs/jobs/exampleprogram.test.sas',
|
|
434
427
|
sasjs_test_id: '',
|
|
435
|
-
result:
|
|
436
|
-
{
|
|
437
|
-
TEST_DESCRIPTION: testDescription,
|
|
438
|
-
TEST_RESULT: testResult
|
|
439
|
-
}
|
|
440
|
-
],
|
|
428
|
+
result: 'not provided',
|
|
441
429
|
test_url: testUrl('jobs/jobs/exampleprogram.test')
|
|
442
430
|
}
|
|
443
431
|
]
|
|
@@ -448,12 +436,7 @@ describe('sasjs test', function () {
|
|
|
448
436
|
{
|
|
449
437
|
test_loc: 'tests/jobs/jobs/standalone.test.sas',
|
|
450
438
|
sasjs_test_id: '',
|
|
451
|
-
result:
|
|
452
|
-
{
|
|
453
|
-
TEST_DESCRIPTION: testDescription,
|
|
454
|
-
TEST_RESULT: testResult
|
|
455
|
-
}
|
|
456
|
-
],
|
|
439
|
+
result: 'not provided',
|
|
457
440
|
test_url: testUrl('jobs/jobs/standalone.test')
|
|
458
441
|
}
|
|
459
442
|
]
|
|
@@ -466,8 +449,8 @@ describe('sasjs test', function () {
|
|
|
466
449
|
sasjs_test_id: '',
|
|
467
450
|
result: [
|
|
468
451
|
{
|
|
469
|
-
TEST_DESCRIPTION:
|
|
470
|
-
TEST_RESULT:
|
|
452
|
+
TEST_DESCRIPTION: 'examplemacro test.1 description',
|
|
453
|
+
TEST_RESULT: 'PASS'
|
|
471
454
|
}
|
|
472
455
|
],
|
|
473
456
|
test_url: testUrl('macros/examplemacro.test')
|
|
@@ -480,12 +463,7 @@ describe('sasjs test', function () {
|
|
|
480
463
|
{
|
|
481
464
|
test_loc: 'tests/macros/shouldFail.test.sas',
|
|
482
465
|
sasjs_test_id: '',
|
|
483
|
-
result:
|
|
484
|
-
{
|
|
485
|
-
TEST_DESCRIPTION: testDescription,
|
|
486
|
-
TEST_RESULT: testResult
|
|
487
|
-
}
|
|
488
|
-
],
|
|
466
|
+
result: 'not provided',
|
|
489
467
|
test_url: testUrl('macros/shouldFail.test')
|
|
490
468
|
}
|
|
491
469
|
]
|
|
@@ -498,8 +476,8 @@ describe('sasjs test', function () {
|
|
|
498
476
|
sasjs_test_id: '',
|
|
499
477
|
result: [
|
|
500
478
|
{
|
|
501
|
-
TEST_DESCRIPTION:
|
|
502
|
-
TEST_RESULT:
|
|
479
|
+
TEST_DESCRIPTION: 'dostuff 0 test description',
|
|
480
|
+
TEST_RESULT: 'FAIL'
|
|
503
481
|
}
|
|
504
482
|
],
|
|
505
483
|
test_url: testUrl('services/admin/dostuff.test.0')
|
|
@@ -509,8 +487,8 @@ describe('sasjs test', function () {
|
|
|
509
487
|
sasjs_test_id: '',
|
|
510
488
|
result: [
|
|
511
489
|
{
|
|
512
|
-
TEST_DESCRIPTION:
|
|
513
|
-
TEST_RESULT:
|
|
490
|
+
TEST_DESCRIPTION: 'dostuff 1 test description',
|
|
491
|
+
TEST_RESULT: 'PASS'
|
|
514
492
|
}
|
|
515
493
|
],
|
|
516
494
|
test_url: testUrl('services/admin/dostuff.test.1')
|
|
@@ -523,34 +501,15 @@ describe('sasjs test', function () {
|
|
|
523
501
|
{
|
|
524
502
|
test_loc: 'tests/testteardown.sas',
|
|
525
503
|
sasjs_test_id: '',
|
|
526
|
-
result:
|
|
527
|
-
{
|
|
528
|
-
TEST_DESCRIPTION: testDescription,
|
|
529
|
-
TEST_RESULT: testResult
|
|
530
|
-
}
|
|
531
|
-
],
|
|
504
|
+
result: 'not provided',
|
|
532
505
|
test_url: testUrl('testteardown')
|
|
533
506
|
}
|
|
534
507
|
]
|
|
535
508
|
}
|
|
536
509
|
]
|
|
537
510
|
};
|
|
538
|
-
expectedResultsCsv = "test_target,test_loc,sasjs_test_id,test_suite_result,test_description,test_url\ntestsetup,tests/testsetup.sas,sasjs_test_id,
|
|
539
|
-
|
|
540
|
-
return Promise.resolve({
|
|
541
|
-
status: 'success',
|
|
542
|
-
_webout: '{"test_results":\r\n' +
|
|
543
|
-
'[\r\n' +
|
|
544
|
-
"{\"TEST_DESCRIPTION\":\"".concat(testDescription, "\" ,\"TEST_RESULT\":\"").concat(testResult, "\" }\r\n") +
|
|
545
|
-
']}',
|
|
546
|
-
log: '1 The SAS System 11:42 Friday, February 11, 2022\r\n' +
|
|
547
|
-
'\r\n' +
|
|
548
|
-
'NOTE: Copyright (c) 2016 by SAS Institute Inc., Cary, NC, USA. \r\n' +
|
|
549
|
-
'NOTE: This session is executing on the X64_10PRO platform.\r\n',
|
|
550
|
-
message: 'success'
|
|
551
|
-
});
|
|
552
|
-
});
|
|
553
|
-
return [4 /*yield*/, (0, test_1.runTest)(target, undefined, undefined, undefined, sasjs)];
|
|
511
|
+
expectedResultsCsv = "test_target,test_loc,sasjs_test_id,test_suite_result,test_description,test_url\ntestsetup,tests/testsetup.sas,sasjs_test_id,not provided,,".concat(testUrlLink('testsetup'), "\nexampleprogram,tests/jobs/jobs/exampleprogram.test.sas,sasjs_test_id,not provided,,").concat(testUrlLink('jobs/jobs/exampleprogram.test'), "\nstandalone,tests/jobs/jobs/standalone.test.sas,sasjs_test_id,not provided,,").concat(testUrlLink('jobs/jobs/standalone.test'), "\nexamplemacro,tests/macros/examplemacro.test.sas,sasjs_test_id,PASS,examplemacro test.1 description,").concat(testUrlLink('macros/examplemacro.test'), "\nshouldFail,tests/macros/shouldFail.test.sas,sasjs_test_id,not provided,,").concat(testUrlLink('macros/shouldFail.test'), "\ndostuff,tests/services/admin/dostuff.test.0.sas,sasjs_test_id,FAIL,dostuff 0 test description,").concat(testUrlLink('services/admin/dostuff.test.0'), "\ndostuff,tests/services/admin/dostuff.test.1.sas,sasjs_test_id,PASS,dostuff 1 test description,").concat(testUrlLink('services/admin/dostuff.test.1'), "\ntestteardown,tests/testteardown.sas,sasjs_test_id,not provided,,").concat(testUrlLink('testteardown'), "\n");
|
|
512
|
+
return [4 /*yield*/, (0, test_1.runTest)(target, undefined, undefined, undefined)];
|
|
554
513
|
case 1:
|
|
555
514
|
_a.sent();
|
|
556
515
|
resultsFolderPath = path_1.default.join(__dirname, target.name, 'sasjsresults');
|
|
@@ -583,7 +542,7 @@ describe('sasjs test', function () {
|
|
|
583
542
|
return [4 /*yield*/, (0, utils_1.readFile)(resultsXmlPath)];
|
|
584
543
|
case 8:
|
|
585
544
|
resultsXml = _a.sent();
|
|
586
|
-
expectedResultsXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<testsuites id=\"\" name=\"SASjs Test Meta\" tests=\"8\" failures=\"
|
|
545
|
+
expectedResultsXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<testsuites id=\"\" name=\"SASjs Test Meta\" tests=\"8\" failures=\"6\">\n <testsuite id=\"testsetup\" name=\"testsetup\" tests=\"1\" failures=\"1\">\n <testcase id=\"\">\n <failure>Status was not provided</failure>\n </testcase>\n </testsuite>\n <testsuite id=\"exampleprogram\" name=\"exampleprogram\" tests=\"1\" failures=\"1\">\n <testcase id=\"\">\n <failure>Status was not provided</failure>\n </testcase>\n </testsuite>\n <testsuite id=\"standalone\" name=\"standalone\" tests=\"1\" failures=\"1\">\n <testcase id=\"\">\n <failure>Status was not provided</failure>\n </testcase>\n </testsuite>\n <testsuite id=\"examplemacro\" name=\"examplemacro\" tests=\"1\" failures=\"0\">\n <testcase id=\"\">\n </testcase>\n </testsuite>\n <testsuite id=\"shouldFail\" name=\"shouldFail\" tests=\"1\" failures=\"1\">\n <testcase id=\"\">\n <failure>Status was not provided</failure>\n </testcase>\n </testsuite>\n <testsuite id=\"dostuff\" name=\"dostuff\" tests=\"2\" failures=\"1\">\n <testcase id=\"\">\n <failure>Description: dostuff 0 test description</failure>\n </testcase>\n <testcase id=\"\">\n </testcase>\n </testsuite>\n <testsuite id=\"testteardown\" name=\"testteardown\" tests=\"1\" failures=\"1\">\n <testcase id=\"\">\n <failure>Status was not provided</failure>\n </testcase>\n </testsuite>\n</testsuites>";
|
|
587
546
|
resultsXml = resultsXml.replace(/testsuites id="[^ ]*"/gm, "testsuites id=\"\"");
|
|
588
547
|
resultsXml = resultsXml.replace(/testcase id="[^ ]*"/gm, "testcase id=\"\"");
|
|
589
548
|
expect(resultsXml).toEqual(expectedResultsXml);
|
|
@@ -605,7 +564,7 @@ function generateTarget(serverType) {
|
|
|
605
564
|
if (serverType === void 0) { serverType = utils_1.ServerType.SasViya; }
|
|
606
565
|
dotenv_1.default.config();
|
|
607
566
|
var timestamp = (0, utils_1.generateTimestamp)();
|
|
608
|
-
var targetName = "cli-tests-test-command-".concat(timestamp);
|
|
567
|
+
var targetName = "cli-tests-test-command-".concat(serverType, "-").concat(timestamp);
|
|
609
568
|
return new utils_1.Target({
|
|
610
569
|
name: targetName,
|
|
611
570
|
serverType: serverType,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { Target } from '@sasjs/utils';
|
|
2
|
-
|
|
3
|
-
export declare function runTest(target: Target, testRegExps?: string[], outDirectory?: string, flowSourcePath?: string, sasjs?: SASjs): Promise<undefined>;
|
|
2
|
+
export declare function runTest(target: Target, testRegExps?: string[], outDirectory?: string, flowSourcePath?: string): Promise<undefined>;
|
|
4
3
|
export declare const getTestUrl: (target: Target, jobLocation: string) => string;
|
|
@@ -86,14 +86,14 @@ var node_1 = __importDefault(require("@sasjs/adapter/node"));
|
|
|
86
86
|
var path_1 = __importDefault(require("path"));
|
|
87
87
|
var chalk_1 = __importDefault(require("chalk"));
|
|
88
88
|
var utils_2 = require("../../utils/utils");
|
|
89
|
-
function runTest(target, testRegExps, outDirectory, flowSourcePath
|
|
89
|
+
function runTest(target, testRegExps, outDirectory, flowSourcePath) {
|
|
90
90
|
var _a, _b;
|
|
91
91
|
if (testRegExps === void 0) { testRegExps = []; }
|
|
92
92
|
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
-
var testFlowData, testFlow, flow, authConfig, username, password, sas9CredentialsError, result, isCodeExamplePrinted, printCodeExample, jsonPath, xmlPath,
|
|
93
|
+
var testFlowData, testFlow, flow, sasjs, authConfig, username, password, _c, sas9CredentialsError, e_1, result, isCodeExamplePrinted, printCodeExample, jsonPath, xmlPath, _d, csvData, csvPath, coverageReportPath, resultTable, testsCount, passedTestsCount, testsWithResultsCount;
|
|
94
94
|
var _this = this;
|
|
95
|
-
return __generator(this, function (
|
|
96
|
-
switch (
|
|
95
|
+
return __generator(this, function (_e) {
|
|
96
|
+
switch (_e.label) {
|
|
97
97
|
case 0:
|
|
98
98
|
if (outDirectory)
|
|
99
99
|
outDirectory = path_1.default.join(process.currentDir, outDirectory);
|
|
@@ -109,7 +109,7 @@ function runTest(target, testRegExps, outDirectory, flowSourcePath, sasjs) {
|
|
|
109
109
|
return Promise.reject("Test flow file was not found at ".concat(flowSourcePath));
|
|
110
110
|
})];
|
|
111
111
|
case 1:
|
|
112
|
-
testFlowData =
|
|
112
|
+
testFlowData = _e.sent();
|
|
113
113
|
if (!testFlowData)
|
|
114
114
|
return [2 /*return*/];
|
|
115
115
|
testFlow = { tests: [] };
|
|
@@ -124,7 +124,7 @@ function runTest(target, testRegExps, outDirectory, flowSourcePath, sasjs) {
|
|
|
124
124
|
flow.push(testFlow.testSetUp);
|
|
125
125
|
if (testFlow.tests)
|
|
126
126
|
flow = __spreadArray(__spreadArray([], __read(flow), false), __read(testFlow.tests.filter(function (test) {
|
|
127
|
-
var
|
|
127
|
+
var e_2, _a;
|
|
128
128
|
if (!testRegExps.length)
|
|
129
129
|
return true;
|
|
130
130
|
var match = false;
|
|
@@ -135,49 +135,63 @@ function runTest(target, testRegExps, outDirectory, flowSourcePath, sasjs) {
|
|
|
135
135
|
match = true;
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
catch (
|
|
138
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
139
139
|
finally {
|
|
140
140
|
try {
|
|
141
141
|
if (testRegExps_1_1 && !testRegExps_1_1.done && (_a = testRegExps_1.return)) _a.call(testRegExps_1);
|
|
142
142
|
}
|
|
143
|
-
finally { if (
|
|
143
|
+
finally { if (e_2) throw e_2.error; }
|
|
144
144
|
}
|
|
145
145
|
return match;
|
|
146
146
|
})), false);
|
|
147
147
|
if (testFlow.testTearDown)
|
|
148
148
|
flow.push(testFlow.testTearDown);
|
|
149
|
-
sasjs =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
149
|
+
sasjs = new node_1.default({
|
|
150
|
+
serverUrl: target.serverUrl,
|
|
151
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
152
|
+
appLoc: target.appLoc,
|
|
153
|
+
serverType: target.serverType,
|
|
154
|
+
debug: true,
|
|
155
|
+
contextName: target.contextName,
|
|
156
|
+
useComputeApi: false
|
|
157
|
+
});
|
|
158
|
+
_c = target.serverType;
|
|
159
|
+
switch (_c) {
|
|
160
|
+
case utils_1.ServerType.SasViya: return [3 /*break*/, 2];
|
|
161
|
+
case utils_1.ServerType.Sas9: return [3 /*break*/, 4];
|
|
162
|
+
case utils_1.ServerType.Sasjs: return [3 /*break*/, 5];
|
|
163
|
+
}
|
|
164
|
+
return [3 /*break*/, 9];
|
|
165
|
+
case 2: return [4 /*yield*/, (0, config_1.getAuthConfig)(target)];
|
|
165
166
|
case 3:
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
167
|
+
authConfig = _e.sent();
|
|
168
|
+
return [3 /*break*/, 9];
|
|
169
|
+
case 4:
|
|
170
|
+
if (target.authConfigSas9) {
|
|
171
|
+
username = target.authConfigSas9.userName;
|
|
172
|
+
password = target.authConfigSas9.password;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
username = process.env.SAS_USERNAME;
|
|
176
|
+
password = process.env.SAS_PASSWORD;
|
|
177
|
+
}
|
|
178
|
+
if (!username || !password) {
|
|
179
|
+
sas9CredentialsError = process.sasjsConstants.sas9CredentialsError;
|
|
180
|
+
throw new Error(sas9CredentialsError);
|
|
180
181
|
}
|
|
182
|
+
password = (0, utils_1.decodeFromBase64)(password);
|
|
183
|
+
return [3 /*break*/, 9];
|
|
184
|
+
case 5:
|
|
185
|
+
_e.trys.push([5, 7, , 8]);
|
|
186
|
+
return [4 /*yield*/, (0, config_1.getAuthConfig)(target)];
|
|
187
|
+
case 6:
|
|
188
|
+
authConfig = _e.sent();
|
|
189
|
+
return [3 /*break*/, 8];
|
|
190
|
+
case 7:
|
|
191
|
+
e_1 = _e.sent();
|
|
192
|
+
return [3 /*break*/, 8];
|
|
193
|
+
case 8: return [3 /*break*/, 9];
|
|
194
|
+
case 9:
|
|
181
195
|
result = {
|
|
182
196
|
sasjs_test_meta: []
|
|
183
197
|
};
|
|
@@ -190,7 +204,7 @@ function runTest(target, testRegExps, outDirectory, flowSourcePath, sasjs) {
|
|
|
190
204
|
}
|
|
191
205
|
};
|
|
192
206
|
return [4 /*yield*/, (0, utils_1.asyncForEach)(flow, function (test) { return __awaiter(_this, void 0, void 0, function () {
|
|
193
|
-
var sasJobLocation, testTarget, testId, testUrl, printTestUrl,
|
|
207
|
+
var sasJobLocation, testTarget, testId, testUrl, printTestUrl, handleRes;
|
|
194
208
|
var _this = this;
|
|
195
209
|
return __generator(this, function (_a) {
|
|
196
210
|
switch (_a.label) {
|
|
@@ -210,55 +224,7 @@ function runTest(target, testRegExps, outDirectory, flowSourcePath, sasjs) {
|
|
|
210
224
|
}
|
|
211
225
|
printTestUrl = function () { return process.logger.info("Test URL: ".concat(testUrl)); };
|
|
212
226
|
printTestUrl();
|
|
213
|
-
|
|
214
|
-
return [4 /*yield*/, sasjs.executeJobSASjs({
|
|
215
|
-
_program: sasJobLocation,
|
|
216
|
-
_debug: 131
|
|
217
|
-
})];
|
|
218
|
-
case 1:
|
|
219
|
-
sasjsResponse = _a.sent();
|
|
220
|
-
if (sasjsResponse._webout) {
|
|
221
|
-
webout = void 0;
|
|
222
|
-
try {
|
|
223
|
-
webout = JSON.parse(sasjsResponse._webout);
|
|
224
|
-
}
|
|
225
|
-
catch (error) {
|
|
226
|
-
return [2 /*return*/, Promise.reject("SASjs Server responded with invalid json")];
|
|
227
|
-
}
|
|
228
|
-
testResults = webout.test_results;
|
|
229
|
-
if (testResults) {
|
|
230
|
-
existingTestTarget = result.sasjs_test_meta.find(function (testResult) {
|
|
231
|
-
return testResult.test_target === testTarget;
|
|
232
|
-
});
|
|
233
|
-
if (existingTestTarget) {
|
|
234
|
-
existingTestTarget.results.push({
|
|
235
|
-
test_loc: test,
|
|
236
|
-
sasjs_test_id: testId,
|
|
237
|
-
result: testResults,
|
|
238
|
-
test_url: testUrl
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
else {
|
|
242
|
-
result.sasjs_test_meta.push({
|
|
243
|
-
test_target: testTarget,
|
|
244
|
-
results: [
|
|
245
|
-
{
|
|
246
|
-
test_loc: test,
|
|
247
|
-
sasjs_test_id: testId,
|
|
248
|
-
result: testResults,
|
|
249
|
-
test_url: testUrl
|
|
250
|
-
}
|
|
251
|
-
]
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
return [3 /*break*/, 4];
|
|
257
|
-
case 2: return [4 /*yield*/, sasjs
|
|
258
|
-
.request(sasJobLocation, {}, { username: username, password: password }, function () {
|
|
259
|
-
(0, displayResult_1.displayError)(null, 'Login callback called. Request failed.');
|
|
260
|
-
}, authConfig, ['log'])
|
|
261
|
-
.then(function (res) { return __awaiter(_this, void 0, void 0, function () {
|
|
227
|
+
handleRes = function (res) { return __awaiter(_this, void 0, void 0, function () {
|
|
262
228
|
var lineBreak, existingTestTarget, existingTestTarget;
|
|
263
229
|
var _a, _b;
|
|
264
230
|
return __generator(this, function (_c) {
|
|
@@ -269,9 +235,7 @@ function runTest(target, testRegExps, outDirectory, flowSourcePath, sasjs) {
|
|
|
269
235
|
(0, displayResult_1.displayError)({}, "Job did not return a response, to debug click ".concat(testUrl));
|
|
270
236
|
printCodeExample();
|
|
271
237
|
lineBreak = false;
|
|
272
|
-
existingTestTarget = result.sasjs_test_meta.find(function (testResult) {
|
|
273
|
-
return testResult.test_target === testTarget;
|
|
274
|
-
});
|
|
238
|
+
existingTestTarget = result.sasjs_test_meta.find(function (testResult) { return testResult.test_target === testTarget; });
|
|
275
239
|
if (existingTestTarget) {
|
|
276
240
|
existingTestTarget.results.push({
|
|
277
241
|
test_loc: test,
|
|
@@ -303,9 +267,7 @@ function runTest(target, testRegExps, outDirectory, flowSourcePath, sasjs) {
|
|
|
303
267
|
_c.label = 2;
|
|
304
268
|
case 2:
|
|
305
269
|
if ((_b = res.result) === null || _b === void 0 ? void 0 : _b.test_results) {
|
|
306
|
-
existingTestTarget = result.sasjs_test_meta.find(function (testResult) {
|
|
307
|
-
return testResult.test_target === testTarget;
|
|
308
|
-
});
|
|
270
|
+
existingTestTarget = result.sasjs_test_meta.find(function (testResult) { return testResult.test_target === testTarget; });
|
|
309
271
|
if (existingTestTarget) {
|
|
310
272
|
existingTestTarget.results.push({
|
|
311
273
|
test_loc: test,
|
|
@@ -328,58 +290,68 @@ function runTest(target, testRegExps, outDirectory, flowSourcePath, sasjs) {
|
|
|
328
290
|
});
|
|
329
291
|
}
|
|
330
292
|
}
|
|
331
|
-
else {
|
|
293
|
+
else if (target.serverType !== utils_1.ServerType.Sasjs) {
|
|
332
294
|
(0, displayResult_1.displayError)({}, "'test_results' not found in server response, to debug click ".concat(testUrl));
|
|
333
295
|
printCodeExample();
|
|
334
296
|
}
|
|
335
297
|
return [2 /*return*/];
|
|
336
298
|
}
|
|
337
299
|
});
|
|
338
|
-
}); }
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
(
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
300
|
+
}); };
|
|
301
|
+
return [4 /*yield*/, sasjs
|
|
302
|
+
.request(sasJobLocation, {}, { username: username, password: password }, function () {
|
|
303
|
+
(0, displayResult_1.displayError)(null, 'Login callback called. Request failed.');
|
|
304
|
+
}, authConfig, ['log'])
|
|
305
|
+
.then(handleRes)
|
|
306
|
+
.catch(function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
307
|
+
var _a, _b, _c;
|
|
308
|
+
return __generator(this, function (_d) {
|
|
309
|
+
switch (_d.label) {
|
|
310
|
+
case 0:
|
|
311
|
+
if (!(((_a = err.error) === null || _a === void 0 ? void 0 : _a.message) === 'Error: invalid Json string')) return [3 /*break*/, 2];
|
|
312
|
+
return [4 /*yield*/, handleRes({})];
|
|
313
|
+
case 1:
|
|
314
|
+
_d.sent();
|
|
315
|
+
return [2 /*return*/];
|
|
316
|
+
case 2:
|
|
317
|
+
printTestUrl();
|
|
318
|
+
if (err && err.errorCode === 404) {
|
|
319
|
+
(0, utils_2.displaySasjsRunnerError)(username);
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
(0, displayResult_1.displayError)({}, "An error occurred while executing the request. Job location: ".concat(sasJobLocation));
|
|
323
|
+
}
|
|
324
|
+
if (!((_c = (_b = err === null || err === void 0 ? void 0 : err.error) === null || _b === void 0 ? void 0 : _b.details) === null || _c === void 0 ? void 0 : _c.result)) return [3 /*break*/, 4];
|
|
325
|
+
return [4 /*yield*/, (0, saveOutput_1.saveLog)(outDirectory, test, err.error.details.result)];
|
|
326
|
+
case 3:
|
|
327
|
+
_d.sent();
|
|
328
|
+
_d.label = 4;
|
|
329
|
+
case 4: return [2 /*return*/];
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}); })];
|
|
333
|
+
case 1:
|
|
361
334
|
_a.sent();
|
|
362
|
-
|
|
363
|
-
case 4: return [2 /*return*/];
|
|
335
|
+
return [2 /*return*/];
|
|
364
336
|
}
|
|
365
337
|
});
|
|
366
338
|
}); })];
|
|
367
|
-
case
|
|
368
|
-
|
|
339
|
+
case 10:
|
|
340
|
+
_e.sent();
|
|
369
341
|
return [4 /*yield*/, (0, saveOutput_1.saveResultJson)(outDirectory, result)];
|
|
370
|
-
case
|
|
371
|
-
jsonPath =
|
|
342
|
+
case 11:
|
|
343
|
+
jsonPath = _e.sent();
|
|
372
344
|
if (!jsonPath)
|
|
373
345
|
return [2 /*return*/];
|
|
374
346
|
return [4 /*yield*/, (0, saveOutput_1.saveResultXml)(outDirectory, result)];
|
|
375
|
-
case
|
|
376
|
-
xmlPath =
|
|
347
|
+
case 12:
|
|
348
|
+
xmlPath = _e.sent();
|
|
377
349
|
return [4 /*yield*/, (0, saveOutput_1.saveResultCsv)(outDirectory, result)];
|
|
378
|
-
case
|
|
379
|
-
|
|
350
|
+
case 13:
|
|
351
|
+
_d = _e.sent(), csvData = _d.csvData, csvPath = _d.csvPath;
|
|
380
352
|
return [4 /*yield*/, (0, saveOutput_1.saveCoverageLcov)(outDirectory, flow)];
|
|
381
|
-
case
|
|
382
|
-
coverageReportPath =
|
|
353
|
+
case 14:
|
|
354
|
+
coverageReportPath = _e.sent();
|
|
383
355
|
resultTable = {};
|
|
384
356
|
if (Array.isArray(csvData)) {
|
|
385
357
|
csvData.forEach(function (item) {
|
package/package.json
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
],
|
|
8
8
|
"scripts": {
|
|
9
9
|
"checkNodeVersion": "node -e \"console.log('\u001b[36m', 'Checking your Node.js version...'); if (!process.versions || !process.versions.node) { console.log('\u001b[31m', 'Error determining Node.js version. Exiting...') } if (parseInt(process.versions.node) < 14) { console.log('\u001b[31m', '❌ You must be running at least Node.js 14 to install SASjs CLI.\\nYour current version is ' + process.versions.node + '.\\nPlease install a more recent version and try again.'); process.exit(1); } else { console.log('\u001b[32m', '✅ Node.js version check passed. Continuing...'); } console.log('\u001b[0m', '');\"",
|
|
10
|
-
"preinstall": "npm run checkNodeVersion -s",
|
|
11
|
-
"prebuild": "npm run checkNodeVersion -s",
|
|
12
10
|
"start": "nodemon --watch \"src/**/*\" --exec \"npm run build && npm run set:permissions\"",
|
|
13
11
|
"set:permissions": "node -e \"require('fs').chmodSync('build/index.js', '755')\"",
|
|
14
12
|
"build": "rimraf build && tsc -p . && npm run copy:files",
|
|
@@ -17,9 +15,9 @@
|
|
|
17
15
|
"test": "npm run test:mocked && npm run test:server",
|
|
18
16
|
"test:server": "jest --silent --runInBand --config=jest.server.config.js",
|
|
19
17
|
"test:mocked": "jest --silent --runInBand --config=jest.config.js --coverage",
|
|
20
|
-
"semantic-release": "semantic-release -d",
|
|
21
18
|
"lint:fix": "npx prettier --write \"{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",
|
|
22
19
|
"lint": "npx prettier --check \"{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",
|
|
20
|
+
"preinstall": "npm run checkNodeVersion -s",
|
|
23
21
|
"prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks || true"
|
|
24
22
|
},
|
|
25
23
|
"release": {
|
|
@@ -49,8 +47,8 @@
|
|
|
49
47
|
"access": "public"
|
|
50
48
|
},
|
|
51
49
|
"dependencies": {
|
|
52
|
-
"@sasjs/adapter": "3.
|
|
53
|
-
"@sasjs/core": "
|
|
50
|
+
"@sasjs/adapter": "3.7.4",
|
|
51
|
+
"@sasjs/core": "4.9.2",
|
|
54
52
|
"@sasjs/lint": "1.11.2",
|
|
55
53
|
"@sasjs/utils": "2.36.0",
|
|
56
54
|
"chalk": "4.1.2",
|
|
@@ -90,12 +88,11 @@
|
|
|
90
88
|
"jest-cli": "27.4.7",
|
|
91
89
|
"jest-extended": "1.1.0",
|
|
92
90
|
"nodemon": "2.0.15",
|
|
93
|
-
"semantic-release": "17.4.7",
|
|
94
91
|
"ts-jest": "27.1.2",
|
|
95
92
|
"ts-node": "10.4.0",
|
|
96
93
|
"tslib": "2.3.1",
|
|
97
94
|
"typescript": "4.5.4",
|
|
98
95
|
"util": "0.12.4"
|
|
99
96
|
},
|
|
100
|
-
"version": "3.7.
|
|
97
|
+
"version": "3.7.7"
|
|
101
98
|
}
|