@sasjs/cli 3.20.4 → 3.20.5

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.
@@ -137,7 +137,7 @@ describe('CompileCommand', function () {
137
137
  targetInfo = _a.sent();
138
138
  expect(command.name).toEqual('compile');
139
139
  expect(command.subCommand).toEqual('');
140
- expect(targetInfo.target).toEqual(target);
140
+ expect(JSON.stringify(targetInfo.target)).toEqual(JSON.stringify(target));
141
141
  expect(targetInfo.isLocal).toBeTrue();
142
142
  return [2 /*return*/];
143
143
  }
@@ -264,7 +264,7 @@ describe('CompileCommand', function () {
264
264
  targetInfo = _a.sent();
265
265
  expect(command.name).toEqual('compile');
266
266
  expect(command.subCommand).toEqual('job');
267
- expect(targetInfo.target).toEqual(target);
267
+ expect(JSON.stringify(targetInfo.target)).toEqual(JSON.stringify(target));
268
268
  expect(targetInfo.isLocal).toBeTrue();
269
269
  return [2 /*return*/];
270
270
  }
@@ -289,14 +289,14 @@ describe('CompileCommand', function () {
289
289
  targetInfo = _a.sent();
290
290
  expect(command.name).toEqual('compile');
291
291
  expect(command.subCommand).toEqual('job');
292
- expect(targetInfo.target).toEqual(target);
292
+ expect(JSON.stringify(targetInfo.target)).toEqual(JSON.stringify(target));
293
293
  expect(targetInfo.isLocal).toBeTrue();
294
294
  return [2 /*return*/];
295
295
  }
296
296
  });
297
297
  }); });
298
298
  it('should call the compileSingleFile handler when executed with the correct target', function () { return __awaiter(void 0, void 0, void 0, function () {
299
- var args, command;
299
+ var args, command, expectedTarget;
300
300
  return __generator(this, function (_a) {
301
301
  switch (_a.label) {
302
302
  case 0:
@@ -312,7 +312,12 @@ describe('CompileCommand', function () {
312
312
  return [4 /*yield*/, command.execute()];
313
313
  case 1:
314
314
  _a.sent();
315
- expect(compileSingleFileModule.compileSingleFile).toHaveBeenCalledWith(target, 'job', path_1.default.join(os_1.default.homedir(), 'test.sas'), expect.anything());
315
+ expectedTarget = {};
316
+ Object.keys(target).forEach(function (key) {
317
+ expectedTarget[key] = target[key];
318
+ });
319
+ delete expectedTarget.getConfig;
320
+ expect(compileSingleFileModule.compileSingleFile).toHaveBeenCalledWith(expect.objectContaining(expectedTarget), 'job', path_1.default.join(os_1.default.homedir(), 'test.sas'), expect.anything());
316
321
  return [2 /*return*/];
317
322
  }
318
323
  });
@@ -131,9 +131,8 @@ function findTargetInConfiguration(targetName, targetScope) {
131
131
  case 0: return [4 /*yield*/, getProjectRoot()];
132
132
  case 1:
133
133
  rootDir = _g.sent();
134
- if (rootDir !== process.projectDir) {
134
+ if (rootDir !== process.projectDir)
135
135
  process.projectDir = rootDir;
136
- }
137
136
  if (!(targetScope === targetScope_1.TargetScope.Local)) return [3 /*break*/, 6];
138
137
  if (!targetName) return [3 /*break*/, 3];
139
138
  _c = {};
@@ -258,7 +257,7 @@ function getLocalTarget(targetName) {
258
257
  case 2:
259
258
  _b.httpsAgentOptions =
260
259
  _c.sent();
261
- return [2 /*return*/, new utils_1.Target(targetJson)];
260
+ return [2 /*return*/, new utils_1.Target(targetJson, localConfig)];
262
261
  case 3: throw new Error(ERROR_MESSAGE(targetName).NOT_FOUND_TARGET_NAME);
263
262
  }
264
263
  });
@@ -293,7 +292,7 @@ function getLocalFallbackTarget() {
293
292
  return [4 /*yield*/, (0, utils_2.loadEnvVariables)(".env.".concat(fallBackTargetJson.name))];
294
293
  case 3:
295
294
  _d.sent();
296
- return [2 /*return*/, new utils_1.Target(fallBackTargetJson)];
295
+ return [2 /*return*/, new utils_1.Target(fallBackTargetJson, localConfig)];
297
296
  case 4: throw new Error(ERROR_MESSAGE().NOT_FOUND_FALLBACK);
298
297
  }
299
298
  });
@@ -322,7 +321,7 @@ function getGlobalTarget(targetName) {
322
321
  case 2:
323
322
  _b.httpsAgentOptions =
324
323
  _c.sent();
325
- return [2 /*return*/, new utils_1.Target(targetJson)];
324
+ return [2 /*return*/, new utils_1.Target(targetJson, globalConfig)];
326
325
  case 3: throw new Error(ERROR_MESSAGE(targetName).NOT_FOUND_TARGET_NAME);
327
326
  }
328
327
  });
@@ -353,7 +352,7 @@ function getGlobalFallbackTarget() {
353
352
  case 2:
354
353
  _c.httpsAgentOptions =
355
354
  _d.sent();
356
- return [2 /*return*/, new utils_1.Target(fallBackTargetJson)];
355
+ return [2 /*return*/, new utils_1.Target(fallBackTargetJson, globalConfig)];
357
356
  case 3: throw new Error(ERROR_MESSAGE().NOT_FOUND_FALLBACK);
358
357
  }
359
358
  });
package/package.json CHANGED
@@ -53,7 +53,7 @@
53
53
  "@sasjs/adapter": "4.0.1",
54
54
  "@sasjs/core": "4.43.1",
55
55
  "@sasjs/lint": "1.13.0",
56
- "@sasjs/utils": "2.49.3",
56
+ "@sasjs/utils": "2.50.0",
57
57
  "adm-zip": "0.5.9",
58
58
  "chalk": "4.1.2",
59
59
  "csv-stringify": "5.6.5",
@@ -99,5 +99,5 @@
99
99
  "typescript": "4.5.4",
100
100
  "util": "0.12.4"
101
101
  },
102
- "version": "3.20.4"
102
+ "version": "3.20.5"
103
103
  }