@datadog/datadog-ci 2.40.0 → 2.40.2

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 (271) hide show
  1. package/dist/__tests__/cli.test.d.ts +1 -0
  2. package/dist/__tests__/cli.test.js +41 -0
  3. package/dist/__tests__/cli.test.js.map +1 -0
  4. package/dist/commands/cloud-run/__tests__/fixtures.d.ts +2 -0
  5. package/dist/commands/cloud-run/__tests__/fixtures.js +12 -0
  6. package/dist/commands/cloud-run/__tests__/fixtures.js.map +1 -0
  7. package/dist/commands/cloud-run/__tests__/flare.test.d.ts +1 -0
  8. package/dist/commands/cloud-run/__tests__/flare.test.js +557 -0
  9. package/dist/commands/cloud-run/__tests__/flare.test.js.map +1 -0
  10. package/dist/commands/deployment/__tests__/mark.test.d.ts +1 -0
  11. package/dist/commands/deployment/__tests__/mark.test.js +47 -0
  12. package/dist/commands/deployment/__tests__/mark.test.js.map +1 -0
  13. package/dist/commands/dora/__tests__/deployment.test.d.ts +1 -0
  14. package/dist/commands/dora/__tests__/deployment.test.js +201 -0
  15. package/dist/commands/dora/__tests__/deployment.test.js.map +1 -0
  16. package/dist/commands/dsyms/__tests__/upload.test.d.ts +1 -0
  17. package/dist/commands/dsyms/__tests__/upload.test.js +346 -0
  18. package/dist/commands/dsyms/__tests__/upload.test.js.map +1 -0
  19. package/dist/commands/dsyms/__tests__/utils.test.d.ts +1 -0
  20. package/dist/commands/dsyms/__tests__/utils.test.js +100 -0
  21. package/dist/commands/dsyms/__tests__/utils.test.js.map +1 -0
  22. package/dist/commands/dsyms/upload.js +3 -3
  23. package/dist/commands/dsyms/upload.js.map +1 -1
  24. package/dist/commands/dsyms/utils.js +4 -2
  25. package/dist/commands/dsyms/utils.js.map +1 -1
  26. package/dist/commands/elf-symbols/__tests__/elf.test.d.ts +1 -0
  27. package/dist/commands/elf-symbols/__tests__/elf.test.js +813 -0
  28. package/dist/commands/elf-symbols/__tests__/elf.test.js.map +1 -0
  29. package/dist/commands/elf-symbols/__tests__/upload.test.d.ts +1 -0
  30. package/dist/commands/elf-symbols/__tests__/upload.test.js +249 -0
  31. package/dist/commands/elf-symbols/__tests__/upload.test.js.map +1 -0
  32. package/dist/commands/elf-symbols/upload.js +2 -3
  33. package/dist/commands/elf-symbols/upload.js.map +1 -1
  34. package/dist/commands/flutter-symbols/__tests__/upload.test.d.ts +1 -0
  35. package/dist/commands/flutter-symbols/__tests__/upload.test.js +617 -0
  36. package/dist/commands/flutter-symbols/__tests__/upload.test.js.map +1 -0
  37. package/dist/commands/flutter-symbols/upload.js +2 -2
  38. package/dist/commands/flutter-symbols/upload.js.map +1 -1
  39. package/dist/commands/gate/__tests__/evaluate.test.d.ts +1 -0
  40. package/dist/commands/gate/__tests__/evaluate.test.js +398 -0
  41. package/dist/commands/gate/__tests__/evaluate.test.js.map +1 -0
  42. package/dist/commands/gate/__tests__/scope.test.d.ts +1 -0
  43. package/dist/commands/gate/__tests__/scope.test.js +29 -0
  44. package/dist/commands/gate/__tests__/scope.test.js.map +1 -0
  45. package/dist/commands/git-metadata/__tests__/git.test.d.ts +1 -0
  46. package/dist/commands/git-metadata/__tests__/git.test.js +132 -0
  47. package/dist/commands/git-metadata/__tests__/git.test.js.map +1 -0
  48. package/dist/commands/git-metadata/__tests__/gitdb.test.d.ts +1 -0
  49. package/dist/commands/git-metadata/__tests__/gitdb.test.js +1386 -0
  50. package/dist/commands/git-metadata/__tests__/gitdb.test.js.map +1 -0
  51. package/dist/commands/git-metadata/__tests__/library.test.d.ts +1 -0
  52. package/dist/commands/git-metadata/__tests__/library.test.js +118 -0
  53. package/dist/commands/git-metadata/__tests__/library.test.js.map +1 -0
  54. package/dist/commands/git-metadata/__tests__/upload.test.d.ts +1 -0
  55. package/dist/commands/git-metadata/__tests__/upload.test.js +52 -0
  56. package/dist/commands/git-metadata/__tests__/upload.test.js.map +1 -0
  57. package/dist/commands/junit/__tests__/id.test.d.ts +1 -0
  58. package/dist/commands/junit/__tests__/id.test.js +24 -0
  59. package/dist/commands/junit/__tests__/id.test.js.map +1 -0
  60. package/dist/commands/junit/__tests__/upload.test.d.ts +1 -0
  61. package/dist/commands/junit/__tests__/upload.test.js +495 -0
  62. package/dist/commands/junit/__tests__/upload.test.js.map +1 -0
  63. package/dist/commands/junit/upload.js +5 -3
  64. package/dist/commands/junit/upload.js.map +1 -1
  65. package/dist/commands/lambda/__tests__/fixtures.d.ts +51 -0
  66. package/dist/commands/lambda/__tests__/fixtures.js +146 -0
  67. package/dist/commands/lambda/__tests__/fixtures.js.map +1 -0
  68. package/dist/commands/lambda/__tests__/flare.test.d.ts +1 -0
  69. package/dist/commands/lambda/__tests__/flare.test.js +730 -0
  70. package/dist/commands/lambda/__tests__/flare.test.js.map +1 -0
  71. package/dist/commands/lambda/__tests__/functions/commons.test.d.ts +1 -0
  72. package/dist/commands/lambda/__tests__/functions/commons.test.js +791 -0
  73. package/dist/commands/lambda/__tests__/functions/commons.test.js.map +1 -0
  74. package/dist/commands/lambda/__tests__/functions/instrument.part1.test.d.ts +1 -0
  75. package/dist/commands/lambda/__tests__/functions/instrument.part1.test.js +386 -0
  76. package/dist/commands/lambda/__tests__/functions/instrument.part1.test.js.map +1 -0
  77. package/dist/commands/lambda/__tests__/functions/instrument.part2.test.d.ts +1 -0
  78. package/dist/commands/lambda/__tests__/functions/instrument.part2.test.js +721 -0
  79. package/dist/commands/lambda/__tests__/functions/instrument.part2.test.js.map +1 -0
  80. package/dist/commands/lambda/__tests__/functions/uninstrument.test.d.ts +1 -0
  81. package/dist/commands/lambda/__tests__/functions/uninstrument.test.js +513 -0
  82. package/dist/commands/lambda/__tests__/functions/uninstrument.test.js.map +1 -0
  83. package/dist/commands/lambda/__tests__/functions/versionChecker.test.d.ts +1 -0
  84. package/dist/commands/lambda/__tests__/functions/versionChecker.test.js +33 -0
  85. package/dist/commands/lambda/__tests__/functions/versionChecker.test.js.map +1 -0
  86. package/dist/commands/lambda/__tests__/instrument.test.d.ts +1 -0
  87. package/dist/commands/lambda/__tests__/instrument.test.js +1511 -0
  88. package/dist/commands/lambda/__tests__/instrument.test.js.map +1 -0
  89. package/dist/commands/lambda/__tests__/loggroup.test.d.ts +1 -0
  90. package/dist/commands/lambda/__tests__/loggroup.test.js +340 -0
  91. package/dist/commands/lambda/__tests__/loggroup.test.js.map +1 -0
  92. package/dist/commands/lambda/__tests__/prompt.test.d.ts +1 -0
  93. package/dist/commands/lambda/__tests__/prompt.test.js +206 -0
  94. package/dist/commands/lambda/__tests__/prompt.test.js.map +1 -0
  95. package/dist/commands/lambda/__tests__/tags.test.d.ts +1 -0
  96. package/dist/commands/lambda/__tests__/tags.test.js +305 -0
  97. package/dist/commands/lambda/__tests__/tags.test.js.map +1 -0
  98. package/dist/commands/lambda/__tests__/uninstrument.test.d.ts +1 -0
  99. package/dist/commands/lambda/__tests__/uninstrument.test.js +722 -0
  100. package/dist/commands/lambda/__tests__/uninstrument.test.js.map +1 -0
  101. package/dist/commands/measure/__tests__/measure.test.d.ts +1 -0
  102. package/dist/commands/measure/__tests__/measure.test.js +110 -0
  103. package/dist/commands/measure/__tests__/measure.test.js.map +1 -0
  104. package/dist/commands/react-native/__tests__/codepush.test.d.ts +1 -0
  105. package/dist/commands/react-native/__tests__/codepush.test.js +161 -0
  106. package/dist/commands/react-native/__tests__/codepush.test.js.map +1 -0
  107. package/dist/commands/react-native/__tests__/interfaces.test.d.ts +1 -0
  108. package/dist/commands/react-native/__tests__/interfaces.test.js +33 -0
  109. package/dist/commands/react-native/__tests__/interfaces.test.js.map +1 -0
  110. package/dist/commands/react-native/__tests__/upload.test.d.ts +1 -0
  111. package/dist/commands/react-native/__tests__/upload.test.js +238 -0
  112. package/dist/commands/react-native/__tests__/upload.test.js.map +1 -0
  113. package/dist/commands/react-native/__tests__/utils.test.d.ts +1 -0
  114. package/dist/commands/react-native/__tests__/utils.test.js +27 -0
  115. package/dist/commands/react-native/__tests__/utils.test.js.map +1 -0
  116. package/dist/commands/react-native/__tests__/xcode.test.d.ts +1 -0
  117. package/dist/commands/react-native/__tests__/xcode.test.js +465 -0
  118. package/dist/commands/react-native/__tests__/xcode.test.js.map +1 -0
  119. package/dist/commands/sarif/__tests__/upload.test.d.ts +1 -0
  120. package/dist/commands/sarif/__tests__/upload.test.js +228 -0
  121. package/dist/commands/sarif/__tests__/upload.test.js.map +1 -0
  122. package/dist/commands/sarif/upload.js +2 -2
  123. package/dist/commands/sarif/upload.js.map +1 -1
  124. package/dist/commands/sbom/__tests__/payload.test.d.ts +1 -0
  125. package/dist/commands/sbom/__tests__/payload.test.js +262 -0
  126. package/dist/commands/sbom/__tests__/payload.test.js.map +1 -0
  127. package/dist/commands/sbom/__tests__/validation.test.d.ts +1 -0
  128. package/dist/commands/sbom/__tests__/validation.test.js +41 -0
  129. package/dist/commands/sbom/__tests__/validation.test.js.map +1 -0
  130. package/dist/commands/sourcemaps/__tests__/upload.test.d.ts +1 -0
  131. package/dist/commands/sourcemaps/__tests__/upload.test.js +270 -0
  132. package/dist/commands/sourcemaps/__tests__/upload.test.js.map +1 -0
  133. package/dist/commands/sourcemaps/__tests__/utils.test.d.ts +1 -0
  134. package/dist/commands/sourcemaps/__tests__/utils.test.js +31 -0
  135. package/dist/commands/sourcemaps/__tests__/utils.test.js.map +1 -0
  136. package/dist/commands/sourcemaps/upload.js +2 -2
  137. package/dist/commands/sourcemaps/upload.js.map +1 -1
  138. package/dist/commands/stepfunctions/__tests__/awsCommands.test.d.ts +1 -0
  139. package/dist/commands/stepfunctions/__tests__/awsCommands.test.js +192 -0
  140. package/dist/commands/stepfunctions/__tests__/awsCommands.test.js.map +1 -0
  141. package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.d.ts +6 -0
  142. package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.js +45 -0
  143. package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.js.map +1 -0
  144. package/dist/commands/stepfunctions/__tests__/fixtures/cli.d.ts +5 -0
  145. package/dist/commands/stepfunctions/__tests__/fixtures/cli.js +19 -0
  146. package/dist/commands/stepfunctions/__tests__/fixtures/cli.js.map +1 -0
  147. package/dist/commands/stepfunctions/__tests__/helpers.test.d.ts +1 -0
  148. package/dist/commands/stepfunctions/__tests__/helpers.test.js +205 -0
  149. package/dist/commands/stepfunctions/__tests__/helpers.test.js.map +1 -0
  150. package/dist/commands/stepfunctions/__tests__/instrument.test.d.ts +1 -0
  151. package/dist/commands/stepfunctions/__tests__/instrument.test.js +431 -0
  152. package/dist/commands/stepfunctions/__tests__/instrument.test.js.map +1 -0
  153. package/dist/commands/stepfunctions/__tests__/uninstrument.test.d.ts +1 -0
  154. package/dist/commands/stepfunctions/__tests__/uninstrument.test.js +166 -0
  155. package/dist/commands/stepfunctions/__tests__/uninstrument.test.js.map +1 -0
  156. package/dist/commands/synthetics/__tests__/api.test.d.ts +1 -0
  157. package/dist/commands/synthetics/__tests__/api.test.js +422 -0
  158. package/dist/commands/synthetics/__tests__/api.test.js.map +1 -0
  159. package/dist/commands/synthetics/__tests__/cli.test.d.ts +1 -0
  160. package/dist/commands/synthetics/__tests__/cli.test.js +1325 -0
  161. package/dist/commands/synthetics/__tests__/cli.test.js.map +1 -0
  162. package/dist/commands/synthetics/__tests__/fixtures.d.ts +149 -0
  163. package/dist/commands/synthetics/__tests__/fixtures.js +507 -0
  164. package/dist/commands/synthetics/__tests__/fixtures.js.map +1 -0
  165. package/dist/commands/synthetics/__tests__/mobile.test.d.ts +1 -0
  166. package/dist/commands/synthetics/__tests__/mobile.test.js +376 -0
  167. package/dist/commands/synthetics/__tests__/mobile.test.js.map +1 -0
  168. package/dist/commands/synthetics/__tests__/reporters/default.test.d.ts +1 -0
  169. package/dist/commands/synthetics/__tests__/reporters/default.test.js +354 -0
  170. package/dist/commands/synthetics/__tests__/reporters/default.test.js.map +1 -0
  171. package/dist/commands/synthetics/__tests__/reporters/junit.test.d.ts +1 -0
  172. package/dist/commands/synthetics/__tests__/reporters/junit.test.js +353 -0
  173. package/dist/commands/synthetics/__tests__/reporters/junit.test.js.map +1 -0
  174. package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.d.ts +1 -0
  175. package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.js +232 -0
  176. package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.js.map +1 -0
  177. package/dist/commands/synthetics/__tests__/run-tests-lib.test.d.ts +1 -0
  178. package/dist/commands/synthetics/__tests__/run-tests-lib.test.js +735 -0
  179. package/dist/commands/synthetics/__tests__/run-tests-lib.test.js.map +1 -0
  180. package/dist/commands/synthetics/__tests__/test.test.d.ts +1 -0
  181. package/dist/commands/synthetics/__tests__/test.test.js +33 -0
  182. package/dist/commands/synthetics/__tests__/test.test.js.map +1 -0
  183. package/dist/commands/synthetics/__tests__/tunnel/crypto.test.d.ts +1 -0
  184. package/dist/commands/synthetics/__tests__/tunnel/crypto.test.js +21 -0
  185. package/dist/commands/synthetics/__tests__/tunnel/crypto.test.js.map +1 -0
  186. package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.d.ts +1 -0
  187. package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.js +80 -0
  188. package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.js.map +1 -0
  189. package/dist/commands/synthetics/__tests__/tunnel/websocket.test.d.ts +1 -0
  190. package/dist/commands/synthetics/__tests__/tunnel/websocket.test.js +109 -0
  191. package/dist/commands/synthetics/__tests__/tunnel/websocket.test.js.map +1 -0
  192. package/dist/commands/synthetics/__tests__/utils/internal.test.d.ts +1 -0
  193. package/dist/commands/synthetics/__tests__/utils/internal.test.js +186 -0
  194. package/dist/commands/synthetics/__tests__/utils/internal.test.js.map +1 -0
  195. package/dist/commands/synthetics/__tests__/utils/public.test.d.ts +1 -0
  196. package/dist/commands/synthetics/__tests__/utils/public.test.js +1526 -0
  197. package/dist/commands/synthetics/__tests__/utils/public.test.js.map +1 -0
  198. package/dist/commands/synthetics/api.d.ts +1 -1
  199. package/dist/commands/synthetics/api.js +10 -5
  200. package/dist/commands/synthetics/api.js.map +1 -1
  201. package/dist/commands/synthetics/run-tests-command.d.ts +1 -0
  202. package/dist/commands/synthetics/run-tests-command.js +3 -2
  203. package/dist/commands/synthetics/run-tests-command.js.map +1 -1
  204. package/dist/commands/synthetics/run-tests-lib.js +0 -4
  205. package/dist/commands/synthetics/run-tests-lib.js.map +1 -1
  206. package/dist/commands/synthetics/test.js +9 -1
  207. package/dist/commands/synthetics/test.js.map +1 -1
  208. package/dist/commands/synthetics/utils/public.js +3 -3
  209. package/dist/commands/synthetics/utils/public.js.map +1 -1
  210. package/dist/commands/tag/__tests__/tag.test.d.ts +1 -0
  211. package/dist/commands/tag/__tests__/tag.test.js +75 -0
  212. package/dist/commands/tag/__tests__/tag.test.js.map +1 -0
  213. package/dist/commands/trace/__tests__/trace.test.d.ts +1 -0
  214. package/dist/commands/trace/__tests__/trace.test.js +145 -0
  215. package/dist/commands/trace/__tests__/trace.test.js.map +1 -0
  216. package/dist/commands/trace/trace.js +1 -1
  217. package/dist/commands/trace/trace.js.map +1 -1
  218. package/dist/commands/unity-symbols/__tests__/upload.test.d.ts +1 -0
  219. package/dist/commands/unity-symbols/__tests__/upload.test.js +369 -0
  220. package/dist/commands/unity-symbols/__tests__/upload.test.js.map +1 -0
  221. package/dist/commands/unity-symbols/upload.js +2 -2
  222. package/dist/commands/unity-symbols/upload.js.map +1 -1
  223. package/dist/helpers/__tests__/app.test.d.ts +1 -0
  224. package/dist/helpers/__tests__/app.test.js +31 -0
  225. package/dist/helpers/__tests__/app.test.js.map +1 -0
  226. package/dist/helpers/__tests__/ci.test.d.ts +1 -0
  227. package/dist/helpers/__tests__/ci.test.js +252 -0
  228. package/dist/helpers/__tests__/ci.test.js.map +1 -0
  229. package/dist/helpers/__tests__/fixtures.d.ts +33 -0
  230. package/dist/helpers/__tests__/fixtures.js +71 -0
  231. package/dist/helpers/__tests__/fixtures.js.map +1 -0
  232. package/dist/helpers/__tests__/flare.test.d.ts +1 -0
  233. package/dist/helpers/__tests__/flare.test.js +226 -0
  234. package/dist/helpers/__tests__/flare.test.js.map +1 -0
  235. package/dist/helpers/__tests__/fs.test.d.ts +1 -0
  236. package/dist/helpers/__tests__/fs.test.js +189 -0
  237. package/dist/helpers/__tests__/fs.test.js.map +1 -0
  238. package/dist/helpers/__tests__/plist.test.d.ts +1 -0
  239. package/dist/helpers/__tests__/plist.test.js +43 -0
  240. package/dist/helpers/__tests__/plist.test.js.map +1 -0
  241. package/dist/helpers/__tests__/prompt.test.d.ts +1 -0
  242. package/dist/helpers/__tests__/prompt.test.js +71 -0
  243. package/dist/helpers/__tests__/prompt.test.js.map +1 -0
  244. package/dist/helpers/__tests__/retry.test.d.ts +1 -0
  245. package/dist/helpers/__tests__/retry.test.js +99 -0
  246. package/dist/helpers/__tests__/retry.test.js.map +1 -0
  247. package/dist/helpers/__tests__/tags.test.d.ts +1 -0
  248. package/dist/helpers/__tests__/tags.test.js +71 -0
  249. package/dist/helpers/__tests__/tags.test.js.map +1 -0
  250. package/dist/helpers/__tests__/upload.test.d.ts +1 -0
  251. package/dist/helpers/__tests__/upload.test.js +231 -0
  252. package/dist/helpers/__tests__/upload.test.js.map +1 -0
  253. package/dist/helpers/__tests__/user-provided-git.test.d.ts +1 -0
  254. package/dist/helpers/__tests__/user-provided-git.test.js +119 -0
  255. package/dist/helpers/__tests__/user-provided-git.test.js.map +1 -0
  256. package/dist/helpers/__tests__/utils.test.d.ts +1 -0
  257. package/dist/helpers/__tests__/utils.test.js +429 -0
  258. package/dist/helpers/__tests__/utils.test.js.map +1 -0
  259. package/dist/helpers/__tests__/validation.test.d.ts +1 -0
  260. package/dist/helpers/__tests__/validation.test.js +25 -0
  261. package/dist/helpers/__tests__/validation.test.js.map +1 -0
  262. package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.d.ts +1 -0
  263. package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.js +103 -0
  264. package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.js.map +1 -0
  265. package/dist/helpers/git/__tests__/format-git-span-data.test.d.ts +1 -0
  266. package/dist/helpers/git/__tests__/format-git-span-data.test.js +121 -0
  267. package/dist/helpers/git/__tests__/format-git-span-data.test.js.map +1 -0
  268. package/dist/helpers/git/__tests__/get-git-data.test.d.ts +1 -0
  269. package/dist/helpers/git/__tests__/get-git-data.test.js +72 -0
  270. package/dist/helpers/git/__tests__/get-git-data.test.js.map +1 -0
  271. package/package.json +4 -6
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ jest.mock('inquirer');
13
+ const inquirer_1 = require("inquirer");
14
+ const constants_1 = require("../../../constants");
15
+ const fixtures_1 = require("../../../helpers/__tests__/fixtures");
16
+ const constants_2 = require("../constants");
17
+ const prompt_1 = require("../prompt");
18
+ const fixtures_2 = require("./fixtures");
19
+ describe('prompt', () => {
20
+ describe('datadogApiKeyTypeQuestion', () => {
21
+ test('returns question with message pointing to the correct given site', () => __awaiter(void 0, void 0, void 0, function* () {
22
+ const site = 'datadoghq.com';
23
+ const question = (0, prompt_1.datadogApiKeyTypeQuestion)(site);
24
+ expect(yield question.message).toBe(`Which type of Datadog API Key you want to set? \nLearn more at https://app.${site}/organization-settings/api-keys`);
25
+ }));
26
+ });
27
+ describe('datadogEnvVarsQuestions', () => {
28
+ test('returns correct message when user selects DATADOG_API_KEY', () => __awaiter(void 0, void 0, void 0, function* () {
29
+ const datadogApiKeyType = {
30
+ envVar: constants_1.CI_API_KEY_ENV_VAR,
31
+ message: 'API Key:',
32
+ };
33
+ const question = (0, prompt_1.datadogEnvVarsQuestions)(datadogApiKeyType);
34
+ expect(yield question.message).toBe('API Key:');
35
+ expect(question.name).toBe(constants_1.CI_API_KEY_ENV_VAR);
36
+ }));
37
+ test('validates DATADOG_API_KEY correctly', () => {
38
+ const datadogApiKeyType = {
39
+ envVar: constants_1.CI_API_KEY_ENV_VAR,
40
+ message: 'API Key:',
41
+ };
42
+ const question = (0, prompt_1.datadogEnvVarsQuestions)(datadogApiKeyType);
43
+ expect(question.validate).not.toBeUndefined();
44
+ expect(question.validate('')).not.toBe(true);
45
+ expect(question.validate('123abc')).not.toBe(true);
46
+ expect(question.validate('1234567890abcdef1200791a6a0de187')).toBe(true);
47
+ });
48
+ test('returns correct message when user selects DATADOG_KMS_API_KEY', () => __awaiter(void 0, void 0, void 0, function* () {
49
+ const datadogApiKeyType = {
50
+ envVar: constants_2.CI_KMS_API_KEY_ENV_VAR,
51
+ message: 'KMS API Key:',
52
+ };
53
+ const question = (0, prompt_1.datadogEnvVarsQuestions)(datadogApiKeyType);
54
+ expect(yield question.message).toBe('KMS API Key:');
55
+ expect(question.name).toBe(constants_2.CI_KMS_API_KEY_ENV_VAR);
56
+ }));
57
+ test('returns correct message when user selects DATADOG_API_KEY_SECRET_ARN', () => __awaiter(void 0, void 0, void 0, function* () {
58
+ const datadogApiKeyType = {
59
+ envVar: constants_2.CI_API_KEY_SECRET_ARN_ENV_VAR,
60
+ message: 'API Key Secret ARN:',
61
+ };
62
+ const question = (0, prompt_1.datadogEnvVarsQuestions)(datadogApiKeyType);
63
+ expect(yield question.message).toBe('API Key Secret ARN:');
64
+ expect(question.name).toBe(constants_2.CI_API_KEY_SECRET_ARN_ENV_VAR);
65
+ }));
66
+ test('validates DATADOG_API_KEY_SECRET_ARN correctly', () => {
67
+ const datadogApiKeyType = {
68
+ envVar: constants_2.CI_API_KEY_SECRET_ARN_ENV_VAR,
69
+ message: 'API Key Secret ARN:',
70
+ };
71
+ const question = (0, prompt_1.datadogEnvVarsQuestions)(datadogApiKeyType);
72
+ expect(question.validate).not.toBeUndefined();
73
+ expect(question.validate('')).not.toBe(true);
74
+ expect(question.validate('123abc')).not.toBe(true);
75
+ expect(question.validate('1234567890abcdef1200791a6a0de187')).not.toBe(true);
76
+ expect(question.validate('arn:aws:secretsmanager:sa-east-1:123456789012:secret:dd-api-key')).toBe(true);
77
+ });
78
+ });
79
+ describe('functionSelectionQuestion', () => {
80
+ test('returns question with the provided function names being its choices', () => {
81
+ const functionNames = ['my-func', 'my-func-2', 'my-third-func'];
82
+ const question = (0, prompt_1.functionSelectionQuestion)(functionNames);
83
+ expect(question.choices).toBe(functionNames);
84
+ });
85
+ });
86
+ describe('requestAWSCrendentials', () => {
87
+ const OLD_ENV = process.env;
88
+ beforeEach(() => {
89
+ jest.resetModules();
90
+ process.env = {};
91
+ });
92
+ afterAll(() => {
93
+ process.env = OLD_ENV;
94
+ });
95
+ test('sets the AWS credentials as environment variables', () => __awaiter(void 0, void 0, void 0, function* () {
96
+ ;
97
+ inquirer_1.prompt.mockImplementation(() => Promise.resolve({
98
+ [constants_2.AWS_ACCESS_KEY_ID_ENV_VAR]: fixtures_2.mockAwsAccessKeyId,
99
+ [constants_2.AWS_SECRET_ACCESS_KEY_ENV_VAR]: fixtures_2.mockAwsSecretAccessKey,
100
+ }));
101
+ yield (0, prompt_1.requestAWSCredentials)();
102
+ expect(process.env[constants_2.AWS_ACCESS_KEY_ID_ENV_VAR]).toBe(fixtures_2.mockAwsAccessKeyId);
103
+ expect(process.env[constants_2.AWS_SECRET_ACCESS_KEY_ENV_VAR]).toBe(fixtures_2.mockAwsSecretAccessKey);
104
+ }));
105
+ test('sets the AWS credentials with session token as environment variables', () => __awaiter(void 0, void 0, void 0, function* () {
106
+ ;
107
+ inquirer_1.prompt.mockImplementation(() => Promise.resolve({
108
+ [constants_2.AWS_ACCESS_KEY_ID_ENV_VAR]: fixtures_2.mockAwsAccessKeyId,
109
+ [constants_2.AWS_SECRET_ACCESS_KEY_ENV_VAR]: fixtures_2.mockAwsSecretAccessKey,
110
+ [constants_2.AWS_SESSION_TOKEN_ENV_VAR]: 'some-session-token',
111
+ }));
112
+ yield (0, prompt_1.requestAWSCredentials)();
113
+ expect(process.env[constants_2.AWS_ACCESS_KEY_ID_ENV_VAR]).toBe(fixtures_2.mockAwsAccessKeyId);
114
+ expect(process.env[constants_2.AWS_SECRET_ACCESS_KEY_ENV_VAR]).toBe(fixtures_2.mockAwsSecretAccessKey);
115
+ expect(process.env[constants_2.AWS_SESSION_TOKEN_ENV_VAR]).toBe('some-session-token');
116
+ }));
117
+ test('throws error when something unexpected happens while prompting', () => __awaiter(void 0, void 0, void 0, function* () {
118
+ ;
119
+ inquirer_1.prompt.mockImplementation(() => Promise.reject(new Error('Unexpected error')));
120
+ let error;
121
+ try {
122
+ yield (0, prompt_1.requestAWSCredentials)();
123
+ }
124
+ catch (e) {
125
+ if (e instanceof Error) {
126
+ error = e;
127
+ }
128
+ }
129
+ expect(error === null || error === void 0 ? void 0 : error.message).toBe("Couldn't set AWS Credentials. Unexpected error");
130
+ }));
131
+ });
132
+ describe('requestDatadogEnvVars', () => {
133
+ const OLD_ENV = process.env;
134
+ beforeEach(() => {
135
+ jest.resetModules();
136
+ process.env = {};
137
+ });
138
+ afterAll(() => {
139
+ process.env = OLD_ENV;
140
+ });
141
+ test('sets the Datadog Environment Variables as provided/selected by user', () => __awaiter(void 0, void 0, void 0, function* () {
142
+ const site = 'datadoghq.com';
143
+ inquirer_1.prompt.mockImplementation((question) => {
144
+ switch (question.name) {
145
+ case constants_1.CI_API_KEY_ENV_VAR:
146
+ return Promise.resolve({
147
+ [constants_1.CI_API_KEY_ENV_VAR]: fixtures_1.MOCK_DATADOG_API_KEY,
148
+ });
149
+ case constants_1.CI_SITE_ENV_VAR:
150
+ return Promise.resolve({
151
+ [constants_1.CI_SITE_ENV_VAR]: 'datadoghq.com',
152
+ });
153
+ case 'type':
154
+ return Promise.resolve({
155
+ type: {
156
+ envVar: constants_1.CI_API_KEY_ENV_VAR,
157
+ message: 'API Key:',
158
+ },
159
+ });
160
+ default:
161
+ }
162
+ });
163
+ yield (0, prompt_1.requestDatadogEnvVars)();
164
+ expect(process.env[constants_1.CI_SITE_ENV_VAR]).toBe(site);
165
+ expect(process.env[constants_1.CI_API_KEY_ENV_VAR]).toBe(fixtures_1.MOCK_DATADOG_API_KEY);
166
+ }));
167
+ test('throws error when something unexpected happens while prompting', () => __awaiter(void 0, void 0, void 0, function* () {
168
+ ;
169
+ inquirer_1.prompt.mockImplementation(() => Promise.reject(new Error('Unexpected error')));
170
+ let error;
171
+ try {
172
+ yield (0, prompt_1.requestDatadogEnvVars)();
173
+ }
174
+ catch (e) {
175
+ if (e instanceof Error) {
176
+ error = e;
177
+ }
178
+ }
179
+ expect(error === null || error === void 0 ? void 0 : error.message).toBe("Couldn't set Datadog Environment Variables. Unexpected error");
180
+ }));
181
+ });
182
+ describe('requestFunctionSelection', () => {
183
+ const selectedFunctions = ['my-func', 'my-func-2', 'my-third-func'];
184
+ test('returns the selected functions', () => __awaiter(void 0, void 0, void 0, function* () {
185
+ ;
186
+ inquirer_1.prompt.mockImplementation(() => Promise.resolve({ functions: selectedFunctions }));
187
+ const functions = yield (0, prompt_1.requestFunctionSelection)(selectedFunctions);
188
+ expect(functions).toBe(selectedFunctions);
189
+ }));
190
+ test('throws error when something unexpected happens while prompting', () => __awaiter(void 0, void 0, void 0, function* () {
191
+ ;
192
+ inquirer_1.prompt.mockImplementation(() => Promise.reject(new Error('Unexpected error')));
193
+ let error;
194
+ try {
195
+ yield (0, prompt_1.requestFunctionSelection)(selectedFunctions);
196
+ }
197
+ catch (e) {
198
+ if (e instanceof Error) {
199
+ error = e;
200
+ }
201
+ }
202
+ expect(error === null || error === void 0 ? void 0 : error.message).toBe("Couldn't receive selected functions. Unexpected error");
203
+ }));
204
+ });
205
+ });
206
+ //# source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,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACxC,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,eAAe,CAAC,CAAA;QACnE,IAAI,CAAC,gCAAgC,EAAE,GAAS,EAAE;YAChD,CAAC;YAAC,iBAAc,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAC,SAAS,EAAE,iBAAiB,EAAC,CAAC,CAAC,CAAA;YAE1F,MAAM,SAAS,GAAG,MAAM,IAAA,iCAAwB,EAAC,iBAAiB,CAAC,CAAA;YACnE,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;QAC3C,CAAC,CAAA,CAAC,CAAA;QAEF,IAAI,CAAC,gEAAgE,EAAE,GAAS,EAAE;YAChF,CAAC;YAAC,iBAAc,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAA;YACxF,IAAI,KAAK,CAAA;YACT,IAAI;gBACF,MAAM,IAAA,iCAAwB,EAAC,iBAAiB,CAAC,CAAA;aAClD;YAAC,OAAO,CAAC,EAAE;gBACV,IAAI,CAAC,YAAY,KAAK,EAAE;oBACtB,KAAK,GAAG,CAAC,CAAA;iBACV;aACF;YACD,MAAM,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAA;QACtF,CAAC,CAAA,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ import 'aws-sdk-client-mock-jest';
@@ -0,0 +1,305 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ jest.mock('../loggroup');
13
+ jest.mock('../../../../package.json', () => ({ version: 'XXXX' }));
14
+ const client_lambda_1 = require("@aws-sdk/client-lambda");
15
+ const aws_sdk_client_mock_1 = require("aws-sdk-client-mock");
16
+ require("aws-sdk-client-mock-jest");
17
+ const constants_1 = require("../constants");
18
+ const tags_1 = require("../tags");
19
+ const fixtures_1 = require("./fixtures");
20
+ describe('tags', () => {
21
+ const lambdaClientMock = (0, aws_sdk_client_mock_1.mockClient)(client_lambda_1.LambdaClient);
22
+ beforeEach(() => {
23
+ lambdaClientMock.reset();
24
+ (0, fixtures_1.mockLambdaClientCommands)(lambdaClientMock);
25
+ });
26
+ describe('applyTagConfig', () => {
27
+ test('tags resources with config', () => __awaiter(void 0, void 0, void 0, function* () {
28
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
29
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
30
+ [functionArn]: {
31
+ config: {
32
+ FunctionArn: functionArn,
33
+ Handler: 'index.handler',
34
+ Runtime: 'nodejs20.x',
35
+ },
36
+ },
37
+ });
38
+ const config = {
39
+ tagResourceCommandInput: {
40
+ Resource: functionArn,
41
+ Tags: {
42
+ [constants_1.TAG_VERSION_NAME]: 'vXXXX',
43
+ },
44
+ },
45
+ };
46
+ yield (0, tags_1.applyTagConfig)(lambdaClientMock, config);
47
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.TagResourceCommand, config.tagResourceCommandInput);
48
+ }));
49
+ test('doesnt tag resources when config is undefined', () => __awaiter(void 0, void 0, void 0, function* () {
50
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
51
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
52
+ [functionArn]: {
53
+ config: {
54
+ FunctionArn: functionArn,
55
+ Handler: 'index.handler',
56
+ Runtime: 'nodejs20.x',
57
+ },
58
+ },
59
+ });
60
+ const config = {
61
+ tagResourceCommandInput: undefined,
62
+ };
63
+ yield (0, tags_1.applyTagConfig)(lambdaClientMock, config);
64
+ expect(lambdaClientMock).toHaveReceivedCommandTimes(client_lambda_1.TagResourceCommand, 0);
65
+ }));
66
+ test('untags resources with config', () => __awaiter(void 0, void 0, void 0, function* () {
67
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
68
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
69
+ [functionArn]: {
70
+ config: {
71
+ FunctionArn: functionArn,
72
+ Handler: 'index.handler',
73
+ Runtime: 'nodejs20.x',
74
+ },
75
+ tags: {
76
+ Tags: {
77
+ [constants_1.TAG_VERSION_NAME]: 'vXXXX',
78
+ },
79
+ },
80
+ },
81
+ });
82
+ const config = {
83
+ untagResourceCommandInput: {
84
+ Resource: functionArn,
85
+ TagKeys: [constants_1.TAG_VERSION_NAME],
86
+ },
87
+ };
88
+ yield (0, tags_1.applyTagConfig)(lambdaClientMock, config);
89
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.UntagResourceCommand, config.untagResourceCommandInput);
90
+ }));
91
+ });
92
+ describe('calculateTagUpdateRequest', () => {
93
+ test('when no tags are present', () => __awaiter(void 0, void 0, void 0, function* () {
94
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
95
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
96
+ [functionArn]: {
97
+ config: {
98
+ FunctionArn: functionArn,
99
+ Handler: 'index.handler',
100
+ Runtime: 'nodejs20.x',
101
+ },
102
+ },
103
+ });
104
+ const result = yield (0, tags_1.calculateTagUpdateRequest)(lambdaClientMock, functionArn);
105
+ expect(result).toEqual({
106
+ tagResourceCommandInput: {
107
+ Resource: functionArn,
108
+ Tags: {
109
+ [constants_1.TAG_VERSION_NAME]: 'vXXXX',
110
+ },
111
+ },
112
+ });
113
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.ListTagsCommand, { Resource: functionArn });
114
+ }));
115
+ test('Handles different version tag', () => __awaiter(void 0, void 0, void 0, function* () {
116
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
117
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
118
+ [functionArn]: {
119
+ config: {
120
+ FunctionArn: functionArn,
121
+ Handler: 'index.handler',
122
+ Runtime: 'nodejs20.x',
123
+ },
124
+ tags: {
125
+ Tags: {
126
+ [constants_1.TAG_VERSION_NAME]: 'v0.0.0',
127
+ },
128
+ },
129
+ },
130
+ });
131
+ const result = yield (0, tags_1.calculateTagUpdateRequest)(lambdaClientMock, functionArn);
132
+ expect(result).toEqual({
133
+ tagResourceCommandInput: {
134
+ Resource: functionArn,
135
+ Tags: {
136
+ [constants_1.TAG_VERSION_NAME]: 'vXXXX',
137
+ },
138
+ },
139
+ });
140
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.ListTagsCommand, { Resource: functionArn });
141
+ }));
142
+ test('Handles sam version tag', () => __awaiter(void 0, void 0, void 0, function* () {
143
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
144
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
145
+ [functionArn]: {
146
+ config: {
147
+ FunctionArn: functionArn,
148
+ Handler: 'index.handler',
149
+ Runtime: 'nodejs20.x',
150
+ },
151
+ tags: {
152
+ Tags: {
153
+ [constants_1.TAG_VERSION_NAME]: 'vXXXX',
154
+ },
155
+ },
156
+ },
157
+ });
158
+ yield (0, tags_1.calculateTagUpdateRequest)(lambdaClientMock, functionArn);
159
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.ListTagsCommand, { Resource: functionArn });
160
+ }));
161
+ });
162
+ describe('calculateTagRemoveRequest', () => {
163
+ test('returns untag resource configuration with the keys to delete', () => __awaiter(void 0, void 0, void 0, function* () {
164
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
165
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
166
+ [functionArn]: {
167
+ config: {
168
+ FunctionArn: functionArn,
169
+ Handler: 'index.handler',
170
+ Runtime: 'nodejs20.x',
171
+ },
172
+ tags: {
173
+ Tags: { [constants_1.TAG_VERSION_NAME]: 'vXXXX' },
174
+ },
175
+ },
176
+ });
177
+ const result = yield (0, tags_1.calculateTagRemoveRequest)(lambdaClientMock, functionArn);
178
+ expect(result).toMatchInlineSnapshot(`
179
+ {
180
+ "untagResourceCommandInput": {
181
+ "Resource": "${functionArn}",
182
+ "TagKeys": [
183
+ "${constants_1.TAG_VERSION_NAME}",
184
+ ],
185
+ },
186
+ }
187
+ `);
188
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.ListTagsCommand, { Resource: functionArn });
189
+ }));
190
+ test('returns undefined when no tags need to be removed', () => __awaiter(void 0, void 0, void 0, function* () {
191
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
192
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
193
+ [functionArn]: {
194
+ config: {
195
+ FunctionArn: functionArn,
196
+ Handler: 'index.handler',
197
+ Runtime: 'nodejs20.x',
198
+ },
199
+ tags: {
200
+ Tags: { not_datadog: 'some-tag' },
201
+ },
202
+ },
203
+ });
204
+ const result = yield (0, tags_1.calculateTagRemoveRequest)(lambdaClientMock, functionArn);
205
+ expect(result).toBeUndefined();
206
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.ListTagsCommand, { Resource: functionArn });
207
+ }));
208
+ });
209
+ describe('hasVersionTag', () => {
210
+ test('handles no tags', () => __awaiter(void 0, void 0, void 0, function* () {
211
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
212
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
213
+ [functionArn]: {
214
+ config: {
215
+ FunctionArn: functionArn,
216
+ Handler: 'index.handler',
217
+ Runtime: 'nodejs20.x',
218
+ },
219
+ },
220
+ });
221
+ const result = yield (0, tags_1.hasVersionTag)(lambdaClientMock, functionArn);
222
+ expect(result).toBe(false);
223
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.ListTagsCommand, { Resource: functionArn });
224
+ }));
225
+ test('handles no version tag', () => __awaiter(void 0, void 0, void 0, function* () {
226
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
227
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
228
+ [functionArn]: {
229
+ config: {
230
+ FunctionArn: functionArn,
231
+ Handler: 'index.handler',
232
+ Runtime: 'nodejs20.x',
233
+ },
234
+ tags: {
235
+ Tags: {
236
+ foo: 'bar',
237
+ },
238
+ },
239
+ },
240
+ });
241
+ const result = yield (0, tags_1.hasVersionTag)(lambdaClientMock, functionArn);
242
+ expect(result).toBe(false);
243
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.ListTagsCommand, { Resource: functionArn });
244
+ }));
245
+ test('handles different version tag', () => __awaiter(void 0, void 0, void 0, function* () {
246
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
247
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
248
+ [functionArn]: {
249
+ config: {
250
+ FunctionArn: functionArn,
251
+ Handler: 'index.handler',
252
+ Runtime: 'nodejs20.x',
253
+ },
254
+ tags: {
255
+ Tags: { [constants_1.TAG_VERSION_NAME]: 'v0.0.0' },
256
+ },
257
+ },
258
+ });
259
+ const result = yield (0, tags_1.hasVersionTag)(lambdaClientMock, functionArn);
260
+ expect(result).toBe(false);
261
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.ListTagsCommand, { Resource: functionArn });
262
+ }));
263
+ test('handles same version tag', () => __awaiter(void 0, void 0, void 0, function* () {
264
+ const functionArn = 'arn:aws:lambda:us-east-1:000000000000:function:autoinstrument';
265
+ (0, fixtures_1.mockLambdaConfigurations)(lambdaClientMock, {
266
+ [functionArn]: {
267
+ config: {
268
+ FunctionArn: functionArn,
269
+ Handler: 'index.handler',
270
+ Runtime: 'nodejs20.x',
271
+ },
272
+ tags: {
273
+ Tags: { [constants_1.TAG_VERSION_NAME]: 'vXXXX' },
274
+ },
275
+ },
276
+ });
277
+ const result = yield (0, tags_1.hasVersionTag)(lambdaClientMock, functionArn);
278
+ expect(result).toBe(true);
279
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.ListTagsCommand, { Resource: functionArn });
280
+ }));
281
+ });
282
+ describe('tagResource', () => {
283
+ test('call is sent correctly', () => __awaiter(void 0, void 0, void 0, function* () {
284
+ const input = {
285
+ Resource: 'some-arn',
286
+ Tags: {
287
+ foo: 'bar',
288
+ },
289
+ };
290
+ yield (0, tags_1.tagResource)(lambdaClientMock, input);
291
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.TagResourceCommand, input);
292
+ }));
293
+ });
294
+ describe('untagResource', () => {
295
+ test('call is sent correctly', () => __awaiter(void 0, void 0, void 0, function* () {
296
+ const input = {
297
+ Resource: 'some-arn',
298
+ TagKeys: ['foo'],
299
+ };
300
+ yield (0, tags_1.untagResource)(lambdaClientMock, input);
301
+ expect(lambdaClientMock).toHaveReceivedCommandWith(client_lambda_1.UntagResourceCommand, input);
302
+ }));
303
+ });
304
+ });
305
+ //# sourceMappingURL=tags.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tags.test.js","sourceRoot":"","sources":["../../../../src/commands/lambda/__tests__/tags.test.ts"],"names":[],"mappings":";;;;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