@sasjs/cli 3.10.0 → 3.10.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/build/commands/compile/compile.js +11 -8
- package/build/commands/compile/compileSingleFile.js +4 -1
- package/build/commands/compile/internal/compileTestFile.d.ts +2 -2
- package/build/commands/compile/internal/compileTestFile.js +2 -3
- package/build/commands/compile/internal/spec/compileTestFile.spec.js +2 -2
- package/build/utils/displayResult.js +1 -1
- package/package.json +2 -2
|
@@ -144,11 +144,14 @@ function compile(target, forceCompile) {
|
|
|
144
144
|
case 10:
|
|
145
145
|
_c.sent();
|
|
146
146
|
_c.label = 11;
|
|
147
|
-
case 11: return [4 /*yield*/,
|
|
147
|
+
case 11: return [4 /*yield*/, compileTree.saveTree()];
|
|
148
148
|
case 12:
|
|
149
149
|
_c.sent();
|
|
150
|
-
return [4 /*yield*/,
|
|
150
|
+
return [4 /*yield*/, (0, compileTestFile_1.compileTestFlow)(target).catch(function (err) { var _a; return (_a = process.logger) === null || _a === void 0 ? void 0 : _a.error('Test flow compilation has failed.'); })];
|
|
151
151
|
case 13:
|
|
152
|
+
_c.sent();
|
|
153
|
+
return [4 /*yield*/, compileWeb(target)];
|
|
154
|
+
case 14:
|
|
152
155
|
_c.sent();
|
|
153
156
|
return [2 /*return*/];
|
|
154
157
|
}
|
|
@@ -251,13 +254,13 @@ function compileJobsServicesTests(target, compileTree) {
|
|
|
251
254
|
case 6:
|
|
252
255
|
testTearDown = _b.sent();
|
|
253
256
|
if (!testSetUp) return [3 /*break*/, 8];
|
|
254
|
-
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, testSetUp, '', true, false).catch(function (err) { var _a; return (_a = process.logger) === null || _a === void 0 ? void 0 : _a.error('Test set up compilation has failed.'); })];
|
|
257
|
+
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, testSetUp, '', true, false, compileTree).catch(function (err) { var _a; return (_a = process.logger) === null || _a === void 0 ? void 0 : _a.error('Test set up compilation has failed.'); })];
|
|
255
258
|
case 7:
|
|
256
259
|
_b.sent();
|
|
257
260
|
_b.label = 8;
|
|
258
261
|
case 8:
|
|
259
262
|
if (!testTearDown) return [3 /*break*/, 10];
|
|
260
|
-
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, testTearDown, '', true, false).catch(function (err) { var _a; return (_a = process.logger) === null || _a === void 0 ? void 0 : _a.error('Test tear down compilation has failed.'); })];
|
|
263
|
+
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, testTearDown, '', true, false, compileTree).catch(function (err) { var _a; return (_a = process.logger) === null || _a === void 0 ? void 0 : _a.error('Test tear down compilation has failed.'); })];
|
|
261
264
|
case 9:
|
|
262
265
|
_b.sent();
|
|
263
266
|
_b.label = 10;
|
|
@@ -340,7 +343,7 @@ var compileServiceFolder = function (target, serviceFolder, macroFolders, progra
|
|
|
340
343
|
case 0:
|
|
341
344
|
filePath = path_1.default.join(destinationPath, fileName);
|
|
342
345
|
if (!(0, utils_1.isTestFile)(filePath)) return [3 /*break*/, 2];
|
|
343
|
-
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, filePath, '', false)];
|
|
346
|
+
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, filePath, '', false, undefined, compileTree)];
|
|
344
347
|
case 1:
|
|
345
348
|
_a.sent();
|
|
346
349
|
return [3 /*break*/, 4];
|
|
@@ -368,7 +371,7 @@ var compileServiceFolder = function (target, serviceFolder, macroFolders, progra
|
|
|
368
371
|
case 0:
|
|
369
372
|
filePath = path_1.default.join(destinationPath, subFolder, fileName);
|
|
370
373
|
if (!(0, utils_1.isTestFile)(filePath)) return [3 /*break*/, 2];
|
|
371
|
-
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, filePath, '', false)];
|
|
374
|
+
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, filePath, '', false, undefined, compileTree)];
|
|
372
375
|
case 1:
|
|
373
376
|
_a.sent();
|
|
374
377
|
return [3 /*break*/, 4];
|
|
@@ -412,7 +415,7 @@ var compileJobFolder = function (target, jobFolder, macroFolders, programFolders
|
|
|
412
415
|
case 0:
|
|
413
416
|
filePath = path_1.default.join(destinationPath, fileName);
|
|
414
417
|
if (!(0, utils_1.isTestFile)(fileName)) return [3 /*break*/, 2];
|
|
415
|
-
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, filePath, '', false)];
|
|
418
|
+
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, filePath, '', false, undefined, compileTree)];
|
|
416
419
|
case 1:
|
|
417
420
|
_a.sent();
|
|
418
421
|
return [3 /*break*/, 4];
|
|
@@ -440,7 +443,7 @@ var compileJobFolder = function (target, jobFolder, macroFolders, programFolders
|
|
|
440
443
|
case 0:
|
|
441
444
|
filePath = path_1.default.join(destinationPath, subFolder, fileName);
|
|
442
445
|
if (!(0, utils_1.isTestFile)(filePath)) return [3 /*break*/, 2];
|
|
443
|
-
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, filePath, '', false)];
|
|
446
|
+
return [4 /*yield*/, (0, compileTestFile_1.compileTestFile)(target, filePath, '', false, undefined, compileTree)];
|
|
444
447
|
case 1:
|
|
445
448
|
_a.sent();
|
|
446
449
|
return [3 /*break*/, 4];
|
|
@@ -128,7 +128,10 @@ function compileSingleFile(target, subCommand, source, output, insertProgramVar)
|
|
|
128
128
|
_c.sent();
|
|
129
129
|
return [3 /*break*/, 16];
|
|
130
130
|
case 15: return [3 /*break*/, 16];
|
|
131
|
-
case 16: return [
|
|
131
|
+
case 16: return [4 /*yield*/, compileTree.saveTree()];
|
|
132
|
+
case 17:
|
|
133
|
+
_c.sent();
|
|
134
|
+
return [2 /*return*/, { destinationPath: destinationPath }];
|
|
132
135
|
}
|
|
133
136
|
});
|
|
134
137
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TestFlow } from '../../../types';
|
|
2
|
-
import { Target, Configuration } from '@sasjs/utils';
|
|
3
|
-
export declare function compileTestFile(target: Target, filePath: string, testVar
|
|
2
|
+
import { Target, Configuration, CompileTree } from '@sasjs/utils';
|
|
3
|
+
export declare function compileTestFile(target: Target, filePath: string, testVar: string | undefined, saveToRoot: boolean | undefined, removeOriginalFile: boolean | undefined, compileTree: CompileTree): Promise<void>;
|
|
4
4
|
export declare function moveTestFile(filePath: string): Promise<void>;
|
|
5
5
|
export declare function copyTestMacroFiles(folderAbsolutePath: string): Promise<void>;
|
|
6
6
|
export declare const compileTestFlow: (target: Target, config?: Configuration | undefined) => Promise<TestFlow | undefined>;
|
|
@@ -77,16 +77,15 @@ var testsBuildFolder = function () {
|
|
|
77
77
|
return path_1.default.join(process.projectDir, 'sasjsbuild', 'tests');
|
|
78
78
|
};
|
|
79
79
|
var getFileName = function (filePath) { return path_1.default.parse(filePath).base; };
|
|
80
|
-
function compileTestFile(target, filePath, testVar, saveToRoot, removeOriginalFile) {
|
|
80
|
+
function compileTestFile(target, filePath, testVar, saveToRoot, removeOriginalFile, compileTree) {
|
|
81
81
|
if (testVar === void 0) { testVar = ''; }
|
|
82
82
|
if (saveToRoot === void 0) { saveToRoot = true; }
|
|
83
83
|
if (removeOriginalFile === void 0) { removeOriginalFile = true; }
|
|
84
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
-
var
|
|
85
|
+
var dependencies, _a, _b, preCode, destinationPath;
|
|
86
86
|
return __generator(this, function (_c) {
|
|
87
87
|
switch (_c.label) {
|
|
88
88
|
case 0:
|
|
89
|
-
compileTree = (0, loadDependencies_1.getCompileTree)(target);
|
|
90
89
|
_a = loadDependencies_1.loadDependencies;
|
|
91
90
|
_b = [target,
|
|
92
91
|
(0, utils_1.getAbsolutePath)(filePath, process.projectDir)];
|
|
@@ -129,8 +129,8 @@ describe('compileTestFile', function () {
|
|
|
129
129
|
case 2:
|
|
130
130
|
testFileContent = _a.apply(void 0, [_b.sent()]);
|
|
131
131
|
testVar = replaceLineBreaks("* Test Variables start;\n\n%let ".concat(Object.keys(target.testConfig.macroVars)[0], "=").concat(Object.values(target.testConfig.macroVars)[0], ";\n\n* Test Variables end;"));
|
|
132
|
-
testInit = replaceLineBreaks("* TestInit start;\n%put testing, init;\n* TestInit end;");
|
|
133
|
-
testTerm = replaceLineBreaks("* TestTerm start;\n%put testing, termed;\n* TestTerm end;");
|
|
132
|
+
testInit = replaceLineBreaks("* TestInit start;\n\n\n%put testing, init;\n* TestInit end;");
|
|
133
|
+
testTerm = replaceLineBreaks("* TestTerm start;\n\n\n%put testing, termed;\n* TestTerm end;");
|
|
134
134
|
mvWebout = "%macro mv_webout(action,ds,fref=_mvwtemp,dslabel=,fmt=Y,stream=Y,missing=NULL<br> ,showmeta=NO<br>);";
|
|
135
135
|
expect(testFileContent.indexOf(testVar)).toBeGreaterThan(-1);
|
|
136
136
|
expect(testFileContent.indexOf(testInit)).toBeGreaterThan(-1);
|
|
@@ -12,7 +12,7 @@ function displayError(err, errorMessage) {
|
|
|
12
12
|
if (errorMessage === void 0) { errorMessage = ''; }
|
|
13
13
|
if (errorMessage)
|
|
14
14
|
errorMessage = "".concat(errorMessage, "\n");
|
|
15
|
-
if (err
|
|
15
|
+
if (err) {
|
|
16
16
|
var failureDetails = '';
|
|
17
17
|
if (err.hasOwnProperty('error')) {
|
|
18
18
|
var body = err.error || null;
|
package/package.json
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@sasjs/adapter": "^3.7.14",
|
|
51
51
|
"@sasjs/core": "4.15.3",
|
|
52
52
|
"@sasjs/lint": "1.11.2",
|
|
53
|
-
"@sasjs/utils": "2.
|
|
53
|
+
"@sasjs/utils": "2.39.0",
|
|
54
54
|
"chalk": "4.1.2",
|
|
55
55
|
"csv-stringify": "5.6.5",
|
|
56
56
|
"dotenv": "10.0.0",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"typescript": "4.5.4",
|
|
95
95
|
"util": "0.12.4"
|
|
96
96
|
},
|
|
97
|
-
"version": "3.10.
|
|
97
|
+
"version": "3.10.1"
|
|
98
98
|
}
|