@datadog/datadog-ci 2.40.1 → 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.
- package/dist/__tests__/cli.test.d.ts +1 -0
- package/dist/__tests__/cli.test.js +41 -0
- package/dist/__tests__/cli.test.js.map +1 -0
- package/dist/commands/cloud-run/__tests__/fixtures.d.ts +2 -0
- package/dist/commands/cloud-run/__tests__/fixtures.js +12 -0
- package/dist/commands/cloud-run/__tests__/fixtures.js.map +1 -0
- package/dist/commands/cloud-run/__tests__/flare.test.d.ts +1 -0
- package/dist/commands/cloud-run/__tests__/flare.test.js +557 -0
- package/dist/commands/cloud-run/__tests__/flare.test.js.map +1 -0
- package/dist/commands/deployment/__tests__/mark.test.d.ts +1 -0
- package/dist/commands/deployment/__tests__/mark.test.js +47 -0
- package/dist/commands/deployment/__tests__/mark.test.js.map +1 -0
- package/dist/commands/dora/__tests__/deployment.test.d.ts +1 -0
- package/dist/commands/dora/__tests__/deployment.test.js +201 -0
- package/dist/commands/dora/__tests__/deployment.test.js.map +1 -0
- package/dist/commands/dsyms/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/dsyms/__tests__/upload.test.js +346 -0
- package/dist/commands/dsyms/__tests__/upload.test.js.map +1 -0
- package/dist/commands/dsyms/__tests__/utils.test.d.ts +1 -0
- package/dist/commands/dsyms/__tests__/utils.test.js +100 -0
- package/dist/commands/dsyms/__tests__/utils.test.js.map +1 -0
- package/dist/commands/dsyms/upload.js +3 -3
- package/dist/commands/dsyms/upload.js.map +1 -1
- package/dist/commands/dsyms/utils.js +4 -2
- package/dist/commands/dsyms/utils.js.map +1 -1
- package/dist/commands/elf-symbols/__tests__/elf.test.d.ts +1 -0
- package/dist/commands/elf-symbols/__tests__/elf.test.js +813 -0
- package/dist/commands/elf-symbols/__tests__/elf.test.js.map +1 -0
- package/dist/commands/elf-symbols/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/elf-symbols/__tests__/upload.test.js +249 -0
- package/dist/commands/elf-symbols/__tests__/upload.test.js.map +1 -0
- package/dist/commands/elf-symbols/upload.js +2 -3
- package/dist/commands/elf-symbols/upload.js.map +1 -1
- package/dist/commands/flutter-symbols/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/flutter-symbols/__tests__/upload.test.js +617 -0
- package/dist/commands/flutter-symbols/__tests__/upload.test.js.map +1 -0
- package/dist/commands/flutter-symbols/upload.js +2 -2
- package/dist/commands/flutter-symbols/upload.js.map +1 -1
- package/dist/commands/gate/__tests__/evaluate.test.d.ts +1 -0
- package/dist/commands/gate/__tests__/evaluate.test.js +398 -0
- package/dist/commands/gate/__tests__/evaluate.test.js.map +1 -0
- package/dist/commands/gate/__tests__/scope.test.d.ts +1 -0
- package/dist/commands/gate/__tests__/scope.test.js +29 -0
- package/dist/commands/gate/__tests__/scope.test.js.map +1 -0
- package/dist/commands/git-metadata/__tests__/git.test.d.ts +1 -0
- package/dist/commands/git-metadata/__tests__/git.test.js +132 -0
- package/dist/commands/git-metadata/__tests__/git.test.js.map +1 -0
- package/dist/commands/git-metadata/__tests__/gitdb.test.d.ts +1 -0
- package/dist/commands/git-metadata/__tests__/gitdb.test.js +1386 -0
- package/dist/commands/git-metadata/__tests__/gitdb.test.js.map +1 -0
- package/dist/commands/git-metadata/__tests__/library.test.d.ts +1 -0
- package/dist/commands/git-metadata/__tests__/library.test.js +118 -0
- package/dist/commands/git-metadata/__tests__/library.test.js.map +1 -0
- package/dist/commands/git-metadata/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/git-metadata/__tests__/upload.test.js +52 -0
- package/dist/commands/git-metadata/__tests__/upload.test.js.map +1 -0
- package/dist/commands/junit/__tests__/id.test.d.ts +1 -0
- package/dist/commands/junit/__tests__/id.test.js +24 -0
- package/dist/commands/junit/__tests__/id.test.js.map +1 -0
- package/dist/commands/junit/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/junit/__tests__/upload.test.js +495 -0
- package/dist/commands/junit/__tests__/upload.test.js.map +1 -0
- package/dist/commands/junit/upload.js +5 -3
- package/dist/commands/junit/upload.js.map +1 -1
- package/dist/commands/lambda/__tests__/fixtures.d.ts +51 -0
- package/dist/commands/lambda/__tests__/fixtures.js +146 -0
- package/dist/commands/lambda/__tests__/fixtures.js.map +1 -0
- package/dist/commands/lambda/__tests__/flare.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/flare.test.js +730 -0
- package/dist/commands/lambda/__tests__/flare.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/functions/commons.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/functions/commons.test.js +791 -0
- package/dist/commands/lambda/__tests__/functions/commons.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part1.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part1.test.js +386 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part1.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part2.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part2.test.js +721 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part2.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/functions/uninstrument.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/functions/uninstrument.test.js +513 -0
- package/dist/commands/lambda/__tests__/functions/uninstrument.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/functions/versionChecker.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/functions/versionChecker.test.js +33 -0
- package/dist/commands/lambda/__tests__/functions/versionChecker.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/instrument.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/instrument.test.js +1511 -0
- package/dist/commands/lambda/__tests__/instrument.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/loggroup.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/loggroup.test.js +340 -0
- package/dist/commands/lambda/__tests__/loggroup.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/prompt.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/prompt.test.js +206 -0
- package/dist/commands/lambda/__tests__/prompt.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/tags.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/tags.test.js +305 -0
- package/dist/commands/lambda/__tests__/tags.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/uninstrument.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/uninstrument.test.js +722 -0
- package/dist/commands/lambda/__tests__/uninstrument.test.js.map +1 -0
- package/dist/commands/measure/__tests__/measure.test.d.ts +1 -0
- package/dist/commands/measure/__tests__/measure.test.js +110 -0
- package/dist/commands/measure/__tests__/measure.test.js.map +1 -0
- package/dist/commands/react-native/__tests__/codepush.test.d.ts +1 -0
- package/dist/commands/react-native/__tests__/codepush.test.js +161 -0
- package/dist/commands/react-native/__tests__/codepush.test.js.map +1 -0
- package/dist/commands/react-native/__tests__/interfaces.test.d.ts +1 -0
- package/dist/commands/react-native/__tests__/interfaces.test.js +33 -0
- package/dist/commands/react-native/__tests__/interfaces.test.js.map +1 -0
- package/dist/commands/react-native/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/react-native/__tests__/upload.test.js +238 -0
- package/dist/commands/react-native/__tests__/upload.test.js.map +1 -0
- package/dist/commands/react-native/__tests__/utils.test.d.ts +1 -0
- package/dist/commands/react-native/__tests__/utils.test.js +27 -0
- package/dist/commands/react-native/__tests__/utils.test.js.map +1 -0
- package/dist/commands/react-native/__tests__/xcode.test.d.ts +1 -0
- package/dist/commands/react-native/__tests__/xcode.test.js +465 -0
- package/dist/commands/react-native/__tests__/xcode.test.js.map +1 -0
- package/dist/commands/sarif/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/sarif/__tests__/upload.test.js +228 -0
- package/dist/commands/sarif/__tests__/upload.test.js.map +1 -0
- package/dist/commands/sarif/upload.js +2 -2
- package/dist/commands/sarif/upload.js.map +1 -1
- package/dist/commands/sbom/__tests__/payload.test.d.ts +1 -0
- package/dist/commands/sbom/__tests__/payload.test.js +262 -0
- package/dist/commands/sbom/__tests__/payload.test.js.map +1 -0
- package/dist/commands/sbom/__tests__/validation.test.d.ts +1 -0
- package/dist/commands/sbom/__tests__/validation.test.js +41 -0
- package/dist/commands/sbom/__tests__/validation.test.js.map +1 -0
- package/dist/commands/sourcemaps/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/sourcemaps/__tests__/upload.test.js +270 -0
- package/dist/commands/sourcemaps/__tests__/upload.test.js.map +1 -0
- package/dist/commands/sourcemaps/__tests__/utils.test.d.ts +1 -0
- package/dist/commands/sourcemaps/__tests__/utils.test.js +31 -0
- package/dist/commands/sourcemaps/__tests__/utils.test.js.map +1 -0
- package/dist/commands/sourcemaps/upload.js +2 -2
- package/dist/commands/sourcemaps/upload.js.map +1 -1
- package/dist/commands/stepfunctions/__tests__/awsCommands.test.d.ts +1 -0
- package/dist/commands/stepfunctions/__tests__/awsCommands.test.js +192 -0
- package/dist/commands/stepfunctions/__tests__/awsCommands.test.js.map +1 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.d.ts +6 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.js +45 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.js.map +1 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/cli.d.ts +5 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/cli.js +19 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/cli.js.map +1 -0
- package/dist/commands/stepfunctions/__tests__/helpers.test.d.ts +1 -0
- package/dist/commands/stepfunctions/__tests__/helpers.test.js +205 -0
- package/dist/commands/stepfunctions/__tests__/helpers.test.js.map +1 -0
- package/dist/commands/stepfunctions/__tests__/instrument.test.d.ts +1 -0
- package/dist/commands/stepfunctions/__tests__/instrument.test.js +431 -0
- package/dist/commands/stepfunctions/__tests__/instrument.test.js.map +1 -0
- package/dist/commands/stepfunctions/__tests__/uninstrument.test.d.ts +1 -0
- package/dist/commands/stepfunctions/__tests__/uninstrument.test.js +166 -0
- package/dist/commands/stepfunctions/__tests__/uninstrument.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/api.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/api.test.js +422 -0
- package/dist/commands/synthetics/__tests__/api.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/cli.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/cli.test.js +1325 -0
- package/dist/commands/synthetics/__tests__/cli.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/fixtures.d.ts +149 -0
- package/dist/commands/synthetics/__tests__/fixtures.js +507 -0
- package/dist/commands/synthetics/__tests__/fixtures.js.map +1 -0
- package/dist/commands/synthetics/__tests__/mobile.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/mobile.test.js +376 -0
- package/dist/commands/synthetics/__tests__/mobile.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/reporters/default.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/reporters/default.test.js +354 -0
- package/dist/commands/synthetics/__tests__/reporters/default.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/reporters/junit.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/reporters/junit.test.js +353 -0
- package/dist/commands/synthetics/__tests__/reporters/junit.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.js +232 -0
- package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/run-tests-lib.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/run-tests-lib.test.js +735 -0
- package/dist/commands/synthetics/__tests__/run-tests-lib.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/test.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/test.test.js +33 -0
- package/dist/commands/synthetics/__tests__/test.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/crypto.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/crypto.test.js +21 -0
- package/dist/commands/synthetics/__tests__/tunnel/crypto.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.js +80 -0
- package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/websocket.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/websocket.test.js +109 -0
- package/dist/commands/synthetics/__tests__/tunnel/websocket.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/utils/internal.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/utils/internal.test.js +186 -0
- package/dist/commands/synthetics/__tests__/utils/internal.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/utils/public.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/utils/public.test.js +1526 -0
- package/dist/commands/synthetics/__tests__/utils/public.test.js.map +1 -0
- package/dist/commands/synthetics/api.d.ts +1 -1
- package/dist/commands/synthetics/api.js +10 -5
- package/dist/commands/synthetics/api.js.map +1 -1
- package/dist/commands/synthetics/run-tests-command.d.ts +1 -0
- package/dist/commands/synthetics/run-tests-command.js +3 -2
- package/dist/commands/synthetics/run-tests-command.js.map +1 -1
- package/dist/commands/synthetics/run-tests-lib.js +0 -4
- package/dist/commands/synthetics/run-tests-lib.js.map +1 -1
- package/dist/commands/synthetics/test.js +9 -1
- package/dist/commands/synthetics/test.js.map +1 -1
- package/dist/commands/synthetics/utils/public.js +3 -3
- package/dist/commands/synthetics/utils/public.js.map +1 -1
- package/dist/commands/tag/__tests__/tag.test.d.ts +1 -0
- package/dist/commands/tag/__tests__/tag.test.js +75 -0
- package/dist/commands/tag/__tests__/tag.test.js.map +1 -0
- package/dist/commands/trace/__tests__/trace.test.d.ts +1 -0
- package/dist/commands/trace/__tests__/trace.test.js +145 -0
- package/dist/commands/trace/__tests__/trace.test.js.map +1 -0
- package/dist/commands/unity-symbols/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/unity-symbols/__tests__/upload.test.js +369 -0
- package/dist/commands/unity-symbols/__tests__/upload.test.js.map +1 -0
- package/dist/commands/unity-symbols/upload.js +2 -2
- package/dist/commands/unity-symbols/upload.js.map +1 -1
- package/dist/helpers/__tests__/app.test.d.ts +1 -0
- package/dist/helpers/__tests__/app.test.js +31 -0
- package/dist/helpers/__tests__/app.test.js.map +1 -0
- package/dist/helpers/__tests__/ci.test.d.ts +1 -0
- package/dist/helpers/__tests__/ci.test.js +252 -0
- package/dist/helpers/__tests__/ci.test.js.map +1 -0
- package/dist/helpers/__tests__/fixtures.d.ts +33 -0
- package/dist/helpers/__tests__/fixtures.js +71 -0
- package/dist/helpers/__tests__/fixtures.js.map +1 -0
- package/dist/helpers/__tests__/flare.test.d.ts +1 -0
- package/dist/helpers/__tests__/flare.test.js +226 -0
- package/dist/helpers/__tests__/flare.test.js.map +1 -0
- package/dist/helpers/__tests__/fs.test.d.ts +1 -0
- package/dist/helpers/__tests__/fs.test.js +189 -0
- package/dist/helpers/__tests__/fs.test.js.map +1 -0
- package/dist/helpers/__tests__/plist.test.d.ts +1 -0
- package/dist/helpers/__tests__/plist.test.js +43 -0
- package/dist/helpers/__tests__/plist.test.js.map +1 -0
- package/dist/helpers/__tests__/prompt.test.d.ts +1 -0
- package/dist/helpers/__tests__/prompt.test.js +71 -0
- package/dist/helpers/__tests__/prompt.test.js.map +1 -0
- package/dist/helpers/__tests__/retry.test.d.ts +1 -0
- package/dist/helpers/__tests__/retry.test.js +99 -0
- package/dist/helpers/__tests__/retry.test.js.map +1 -0
- package/dist/helpers/__tests__/tags.test.d.ts +1 -0
- package/dist/helpers/__tests__/tags.test.js +71 -0
- package/dist/helpers/__tests__/tags.test.js.map +1 -0
- package/dist/helpers/__tests__/upload.test.d.ts +1 -0
- package/dist/helpers/__tests__/upload.test.js +231 -0
- package/dist/helpers/__tests__/upload.test.js.map +1 -0
- package/dist/helpers/__tests__/user-provided-git.test.d.ts +1 -0
- package/dist/helpers/__tests__/user-provided-git.test.js +119 -0
- package/dist/helpers/__tests__/user-provided-git.test.js.map +1 -0
- package/dist/helpers/__tests__/utils.test.d.ts +1 -0
- package/dist/helpers/__tests__/utils.test.js +429 -0
- package/dist/helpers/__tests__/utils.test.js.map +1 -0
- package/dist/helpers/__tests__/validation.test.d.ts +1 -0
- package/dist/helpers/__tests__/validation.test.js +25 -0
- package/dist/helpers/__tests__/validation.test.js.map +1 -0
- package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.d.ts +1 -0
- package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.js +103 -0
- package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.js.map +1 -0
- package/dist/helpers/git/__tests__/format-git-span-data.test.d.ts +1 -0
- package/dist/helpers/git/__tests__/format-git-span-data.test.js +121 -0
- package/dist/helpers/git/__tests__/format-git-span-data.test.js.map +1 -0
- package/dist/helpers/git/__tests__/get-git-data.test.d.ts +1 -0
- package/dist/helpers/git/__tests__/get-git-data.test.js +72 -0
- package/dist/helpers/git/__tests__/get-git-data.test.js.map +1 -0
- package/package.json +4 -6
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
const simpleGit = __importStar(require("simple-git"));
|
|
36
|
+
const git_1 = require("../git");
|
|
37
|
+
const createMockSimpleGit = (conf) => ({
|
|
38
|
+
// eslint-disable-next-line no-null/no-null
|
|
39
|
+
getConfig: (_) => ({ value: null }),
|
|
40
|
+
getRemotes: (_) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
if (conf.remotes === undefined) {
|
|
42
|
+
throw Error('Unexpected call to getRemotes');
|
|
43
|
+
}
|
|
44
|
+
return conf.remotes;
|
|
45
|
+
}),
|
|
46
|
+
raw: (command) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
if (command === 'ls-files' && conf.trackedFiles !== undefined) {
|
|
48
|
+
return conf.trackedFiles.join('\n') + '\n';
|
|
49
|
+
}
|
|
50
|
+
throw Error(`Unexpected call to raw(${command})`);
|
|
51
|
+
}),
|
|
52
|
+
revparse: (_) => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
+
if (conf.hash === undefined) {
|
|
54
|
+
throw Error('Unexpected call to revparse');
|
|
55
|
+
}
|
|
56
|
+
return conf.hash;
|
|
57
|
+
}),
|
|
58
|
+
});
|
|
59
|
+
describe('git', () => {
|
|
60
|
+
describe('stripCredentials: git protocol', () => {
|
|
61
|
+
test('should return the same value', () => {
|
|
62
|
+
const input = 'git@github.com:user/project.git';
|
|
63
|
+
expect((0, git_1.stripCredentials)(input)).toBe(input);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
describe('stripCredentials: nothing to remove', () => {
|
|
67
|
+
test('should return the same value', () => {
|
|
68
|
+
const input = 'https://gitlab.com/user/project.git';
|
|
69
|
+
expect((0, git_1.stripCredentials)(input)).toBe(input);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe('stripCredentials: user:pwd', () => {
|
|
73
|
+
test('should return without credentials', () => {
|
|
74
|
+
const input = 'https://token:[MASKED]@gitlab.com/user/project.git';
|
|
75
|
+
expect((0, git_1.stripCredentials)(input)).toBe('https://gitlab.com/user/project.git');
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe('stripCredentials: token', () => {
|
|
79
|
+
test('should return without credentials', () => {
|
|
80
|
+
const input = 'https://token@gitlab.com/user/project.git';
|
|
81
|
+
expect((0, git_1.stripCredentials)(input)).toBe('https://gitlab.com/user/project.git');
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
describe('getCommitInfo', () => {
|
|
85
|
+
test('should return commit info from simple git', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
86
|
+
const mock = createMockSimpleGit({
|
|
87
|
+
hash: 'abcd',
|
|
88
|
+
remotes: [{ name: 'first', refs: { push: 'https://git-repo' } }],
|
|
89
|
+
trackedFiles: ['myfile.js'],
|
|
90
|
+
});
|
|
91
|
+
const commitInfo = yield (0, git_1.getCommitInfo)(mock);
|
|
92
|
+
expect(commitInfo).toBeDefined();
|
|
93
|
+
expect(commitInfo.hash).toBe('abcd');
|
|
94
|
+
expect(commitInfo.trackedFiles).toStrictEqual(['myfile.js']);
|
|
95
|
+
expect(commitInfo.remote).toBe('https://git-repo/');
|
|
96
|
+
}));
|
|
97
|
+
test('should return commit info with overridden repo name', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
98
|
+
const mock = createMockSimpleGit({
|
|
99
|
+
hash: 'abcd',
|
|
100
|
+
trackedFiles: ['myfile.js'],
|
|
101
|
+
});
|
|
102
|
+
const commitInfo = yield (0, git_1.getCommitInfo)(mock, 'https://overridden');
|
|
103
|
+
expect(commitInfo).toBeDefined();
|
|
104
|
+
expect(commitInfo.hash).toBe('abcd');
|
|
105
|
+
expect(commitInfo.trackedFiles).toStrictEqual(['myfile.js']);
|
|
106
|
+
expect(commitInfo.remote).toBe('https://overridden');
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
109
|
+
describe('newSimpleGit', () => {
|
|
110
|
+
test('should throw an error if git is not installed', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
111
|
+
jest.spyOn(simpleGit, 'simpleGit').mockImplementation(() => {
|
|
112
|
+
throw Error('gitp error');
|
|
113
|
+
});
|
|
114
|
+
yield expect((0, git_1.newSimpleGit)()).rejects.toThrow('gitp error');
|
|
115
|
+
}));
|
|
116
|
+
test('should throw an error if revparse throws an error', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
117
|
+
const mock = createMockSimpleGit({});
|
|
118
|
+
jest.spyOn(simpleGit, 'simpleGit').mockReturnValue(mock);
|
|
119
|
+
jest.spyOn(mock, 'revparse').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
120
|
+
throw Error('revparse error');
|
|
121
|
+
}));
|
|
122
|
+
yield expect((0, git_1.newSimpleGit)()).rejects.toThrow('revparse error');
|
|
123
|
+
}));
|
|
124
|
+
test('should not throw any errors', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
125
|
+
const mock = createMockSimpleGit({});
|
|
126
|
+
jest.spyOn(simpleGit, 'simpleGit').mockReturnValue(mock);
|
|
127
|
+
jest.spyOn(mock, 'revparse').mockResolvedValue('1234');
|
|
128
|
+
yield expect((0, git_1.newSimpleGit)()).resolves.not.toThrow();
|
|
129
|
+
}));
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
//# sourceMappingURL=git.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.test.js","sourceRoot":"","sources":["../../../../src/commands/git-metadata/__tests__/git.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAuC;AAEvC,gCAAoE;AAQpE,MAAM,mBAAmB,GAAG,CAAC,IAAgB,EAAE,EAAE,CAAC,CAAC;IACjD,2CAA2C;IAC3C,SAAS,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;IACzC,UAAU,EAAE,CAAO,CAAU,EAAE,EAAE;QAC/B,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;YAC9B,MAAM,KAAK,CAAC,+BAA+B,CAAC,CAAA;SAC7C;QAED,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC,CAAA;IACD,GAAG,EAAE,CAAO,OAAe,EAAE,EAAE;QAC7B,IAAI,OAAO,KAAK,UAAU,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;YAC7D,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;SAC3C;QACD,MAAM,KAAK,CAAC,0BAA0B,OAAO,GAAG,CAAC,CAAA;IACnD,CAAC,CAAA;IACD,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