azure-pipelines-tasks-webdeployment-common 4.230.2 → 4.230.3

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/Tests/L0.js CHANGED
@@ -9,6 +9,7 @@ const L1JSONVarSubWithComments_1 = require("./L1JSONVarSubWithComments");
9
9
  const L1JsonVarSub_1 = require("./L1JsonVarSub");
10
10
  const L1JsonVarSubV2_1 = require("./L1JsonVarSubV2");
11
11
  const L1ValidateFileEncoding_1 = require("./L1ValidateFileEncoding");
12
+ const L0ParameterParserUtility_1 = require("./L0ParameterParserUtility");
12
13
  describe('Web deployment common tests', () => {
13
14
  describe('GetMSDeployCmdArgs tests', L0MSDeployUtility_1.runGetMSDeployCmdArgsTests);
14
15
  describe('GetWebDeployErrorCode tests', L0MSDeployUtility_1.runGetWebDeployErrorCodeTests);
@@ -20,4 +21,5 @@ describe('Web deployment common tests', () => {
20
21
  describe("L1JsonVarSub tests", L1JsonVarSub_1.runL1JsonVarSubTests);
21
22
  describe("L1JsonVarSubV2 tests", L1JsonVarSubV2_1.runL1JsonVarSubV2Tests);
22
23
  describe("L1ValidateFileEncoding tests", L1ValidateFileEncoding_1.runL1ValidateFileEncodingTests);
24
+ describe("ParameterParserUtility tests", L0ParameterParserUtility_1.runParameterParserUtilityTests);
23
25
  });
package/Tests/L0.ts CHANGED
@@ -7,6 +7,7 @@ import { runL1JSONVarSubWithCommentsTests } from "./L1JSONVarSubWithComments";
7
7
  import { runL1JsonVarSubTests } from "./L1JsonVarSub";
8
8
  import { runL1JsonVarSubV2Tests } from "./L1JsonVarSubV2";
9
9
  import { runL1ValidateFileEncodingTests } from "./L1ValidateFileEncoding";
10
+ import { runParameterParserUtilityTests } from "./L0ParameterParserUtility";
10
11
 
11
12
  describe('Web deployment common tests', () => {
12
13
  describe('GetMSDeployCmdArgs tests', runGetMSDeployCmdArgsTests);
@@ -19,4 +20,5 @@ describe('Web deployment common tests', () => {
19
20
  describe("L1JsonVarSub tests", runL1JsonVarSubTests);
20
21
  describe("L1JsonVarSubV2 tests", runL1JsonVarSubV2Tests);
21
22
  describe("L1ValidateFileEncoding tests", runL1ValidateFileEncodingTests);
23
+ describe("ParameterParserUtility tests", runParameterParserUtilityTests);
22
24
  });
@@ -1,8 +1,6 @@
1
1
  import assert = require("assert");
2
2
  import { getMSDeployCmdArgs, getWebDeployErrorCode } from "../msdeployutility";
3
3
 
4
-
5
-
6
4
  export function runGetMSDeployCmdArgsTests() {
7
5
 
8
6
  it('Should produce default valid args', () => {
@@ -0,0 +1 @@
1
+ export declare function runParameterParserUtilityTests(): void;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runParameterParserUtilityTests = void 0;
4
+ const assert = require("assert");
5
+ const ParameterParserUtility_1 = require("../ParameterParserUtility");
6
+ function runParameterParserUtilityTests() {
7
+ it("Should parse parameters", () => {
8
+ const paramString = "-port 8080 -Release.ReleaseName Release-1173";
9
+ const expectedJSON = {
10
+ "port": {
11
+ value: "8080"
12
+ },
13
+ "Release.ReleaseName": {
14
+ value: "Release-1173"
15
+ }
16
+ };
17
+ const result = ParameterParserUtility_1.parse(paramString);
18
+ assert.deepStrictEqual(result, expectedJSON);
19
+ });
20
+ it("Should parse parameters with empty values", () => {
21
+ const paramString = "-port 8080 -ErrorCode -ErrorMessage -Release.ReleaseName Release-1173";
22
+ const expectedJSON = {
23
+ "port": {
24
+ value: "8080"
25
+ },
26
+ "ErrorCode": {
27
+ value: ""
28
+ },
29
+ "ErrorMessage": {
30
+ value: ""
31
+ },
32
+ "Release.ReleaseName": {
33
+ value: "Release-1173"
34
+ }
35
+ };
36
+ const result = ParameterParserUtility_1.parse(paramString);
37
+ assert.deepStrictEqual(result, expectedJSON);
38
+ });
39
+ it("Should parse parameters with extra spaces", () => {
40
+ const paramString = "-port 8080 -ErrorCode -ErrorMessage -Release.ReleaseName Release-1173";
41
+ const expectedJSON = {
42
+ "port": {
43
+ value: "8080"
44
+ },
45
+ "ErrorCode": {
46
+ value: ""
47
+ },
48
+ "ErrorMessage": {
49
+ value: ""
50
+ },
51
+ "Release.ReleaseName": {
52
+ value: "Release-1173"
53
+ }
54
+ };
55
+ const result = ParameterParserUtility_1.parse(paramString);
56
+ assert.deepStrictEqual(result, expectedJSON);
57
+ });
58
+ }
59
+ exports.runParameterParserUtilityTests = runParameterParserUtilityTests;
@@ -0,0 +1,65 @@
1
+ import assert = require('assert');
2
+ import { parse } from '../ParameterParserUtility';
3
+
4
+ export function runParameterParserUtilityTests(): void {
5
+
6
+ it("Should parse parameters", () => {
7
+ const paramString = "-port 8080 -Release.ReleaseName Release-1173";
8
+ const expectedJSON = {
9
+ "port": {
10
+ value: "8080"
11
+ },
12
+ "Release.ReleaseName": {
13
+ value: "Release-1173"
14
+ }
15
+ };
16
+
17
+ const result = parse(paramString);
18
+
19
+ assert.deepStrictEqual(result, expectedJSON);
20
+ });
21
+
22
+ it("Should parse parameters with empty values", () => {
23
+ const paramString = "-port 8080 -ErrorCode -ErrorMessage -Release.ReleaseName Release-1173";
24
+ const expectedJSON = {
25
+ "port": {
26
+ value: "8080"
27
+ },
28
+ "ErrorCode": {
29
+ value: ""
30
+ },
31
+ "ErrorMessage": {
32
+ value: ""
33
+ },
34
+ "Release.ReleaseName": {
35
+ value: "Release-1173"
36
+ }
37
+ };
38
+
39
+ const result = parse(paramString);
40
+
41
+ assert.deepStrictEqual(result, expectedJSON);
42
+ });
43
+
44
+ it("Should parse parameters with extra spaces", () => {
45
+ const paramString = "-port 8080 -ErrorCode -ErrorMessage -Release.ReleaseName Release-1173";
46
+ const expectedJSON = {
47
+ "port": {
48
+ value: "8080"
49
+ },
50
+ "ErrorCode": {
51
+ value: ""
52
+ },
53
+ "ErrorMessage": {
54
+ value: ""
55
+ },
56
+ "Release.ReleaseName": {
57
+ value: "Release-1173"
58
+ }
59
+ };
60
+
61
+ const result = parse(paramString);
62
+
63
+ assert.deepStrictEqual(result, expectedJSON);
64
+ });
65
+ }
@@ -28,7 +28,6 @@ function runL1JSONVarSubWithCommentsTests() {
28
28
  it("Should throw exception for invalid JSON with comments", (done) => {
29
29
  const fileContent = fs.readFileSync(path.join(__dirname, 'L1JSONVarSub', 'InvalidJSONWithComments.json'), 'utf-8');
30
30
  const jsonContent = jsonvariablesubstitutionutility_1.stripJsonComments(fileContent);
31
- console.log(jsonContent);
32
31
  assert.throws(() => JSON.parse(jsonContent), "Parse is expected to throw an error");
33
32
  done();
34
33
  });
@@ -33,7 +33,6 @@ export function runL1JSONVarSubWithCommentsTests(): void {
33
33
  it("Should throw exception for invalid JSON with comments", (done: Mocha.Done) => {
34
34
  const fileContent = fs.readFileSync(path.join(__dirname, 'L1JSONVarSub', 'InvalidJSONWithComments.json'), 'utf-8');
35
35
  const jsonContent = stripJsonComments(fileContent);
36
- console.log(jsonContent);
37
36
  assert.throws(() => JSON.parse(jsonContent), "Parse is expected to throw an error");
38
37
  done();
39
38
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-pipelines-tasks-webdeployment-common",
3
- "version": "4.230.2",
3
+ "version": "4.230.3",
4
4
  "description": "Common Lib for MSDeploy Utility",
5
5
  "repository": {
6
6
  "type": "git",