azure-pipelines-tasks-webdeployment-common 4.230.0 → 4.230.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 (56) hide show
  1. package/MSDeploy/M229/MSDeploy3.6/Microsoft.VisualStudio.RemoteControl.dll +0 -0
  2. package/MSDeploy/M229/MSDeploy3.6/Microsoft.VisualStudio.Telemetry.dll +0 -0
  3. package/MSDeploy/M229/MSDeploy3.6/Microsoft.VisualStudio.Utilities.Internal.dll +0 -0
  4. package/MSDeploy/M229/MSDeploy3.6/Microsoft.Web.Delegation.dll +0 -0
  5. package/MSDeploy/M229/MSDeploy3.6/Microsoft.Web.Deployment.Powershell.dll +0 -0
  6. package/MSDeploy/M229/MSDeploy3.6/Microsoft.Web.Deployment.Tracing.dll +0 -0
  7. package/MSDeploy/M229/MSDeploy3.6/Microsoft.Web.Deployment.dll +0 -0
  8. package/MSDeploy/M229/MSDeploy3.6/Newtonsoft.Json.dll +0 -0
  9. package/MSDeploy/M229/MSDeploy3.6/msdeploy.exe +0 -0
  10. package/MSDeploy/M229/MSDeploy3.6/msdeploy.exe.config +7 -0
  11. package/Tests/L0.d.ts +1 -0
  12. package/Tests/L0.js +23 -0
  13. package/Tests/L0.ts +22 -0
  14. package/Tests/L0CopyDirectory.d.ts +1 -5
  15. package/Tests/L0CopyDirectory.js +89 -51
  16. package/Tests/L0CopyDirectory.ts +93 -55
  17. package/Tests/L0GenerateWebConfig.d.ts +1 -2
  18. package/Tests/L0GenerateWebConfig.js +55 -24
  19. package/Tests/L0GenerateWebConfig.ts +51 -31
  20. package/Tests/L0MSDeployUtility.d.ts +2 -15
  21. package/Tests/L0MSDeployUtility.js +91 -87
  22. package/Tests/L0MSDeployUtility.ts +93 -90
  23. package/Tests/L1JSONVarSubWithComments.d.ts +1 -1
  24. package/Tests/L1JSONVarSubWithComments.js +31 -46
  25. package/Tests/L1JSONVarSubWithComments.ts +40 -52
  26. package/Tests/L1JsonVarSub.d.ts +1 -1
  27. package/Tests/L1JsonVarSub.js +58 -66
  28. package/Tests/L1JsonVarSub.ts +67 -66
  29. package/Tests/L1JsonVarSubV2.d.ts +1 -1
  30. package/Tests/L1JsonVarSubV2.js +82 -93
  31. package/Tests/L1JsonVarSubV2.ts +82 -94
  32. package/Tests/L1ValidateFileEncoding.d.ts +2 -5
  33. package/Tests/L1ValidateFileEncoding.js +52 -65
  34. package/Tests/L1ValidateFileEncoding.ts +61 -77
  35. package/Tests/L1XdtTransform.d.ts +2 -3
  36. package/Tests/L1XdtTransform.js +48 -6
  37. package/Tests/L1XdtTransform.ts +57 -6
  38. package/Tests/L1XmlVarSub.d.ts +2 -3
  39. package/Tests/L1XmlVarSub.js +56 -20
  40. package/Tests/L1XmlVarSub.ts +81 -24
  41. package/ctt/ctt/ctt.exe +0 -0
  42. package/deployusingmsdeploy.d.ts +2 -2
  43. package/deployusingmsdeploy.js +18 -12
  44. package/module.json +5 -1
  45. package/msdeployutility.d.ts +7 -4
  46. package/msdeployutility.js +102 -54
  47. package/package.json +7 -3
  48. package/packageUtility.js +6 -5
  49. package/utility.js +1 -1
  50. package/webconfigutil.d.ts +3 -1
  51. package/xdttransformationutility.js +1 -1
  52. /package/{MSDeploy3.6 → MSDeploy/M142}/MSDeploy3.6/Microsoft.Web.Delegation.dll +0 -0
  53. /package/{MSDeploy3.6 → MSDeploy/M142}/MSDeploy3.6/Microsoft.Web.Deployment.Tracing.dll +0 -0
  54. /package/{MSDeploy3.6 → MSDeploy/M142}/MSDeploy3.6/Microsoft.Web.Deployment.dll +0 -0
  55. /package/{MSDeploy3.6 → MSDeploy/M142}/MSDeploy3.6/msdeploy.exe +0 -0
  56. /package/{MSDeploy3.6 → MSDeploy/M142}/MSDeploy3.6/msdeploy.exe.config +0 -0
@@ -1,69 +1,61 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const L1JSONVarSubWithComments_1 = require("./L1JSONVarSubWithComments");
4
- var jsonSubUtil = require('azure-pipelines-tasks-webdeployment-common/jsonvariablesubstitutionutility.js');
5
- var envVarObject = jsonSubUtil.createEnvTree([
6
- { name: 'system.debug', value: 'true', secret: false },
7
- { name: 'data.ConnectionString', value: 'database_connection', secret: false },
8
- { name: 'data.userName', value: 'db_admin', secret: false },
9
- { name: 'data.password', value: 'db_pass', secret: true },
10
- { name: '&pl.ch@r@cter.k^y', value: '*.config', secret: false },
11
- { name: 'build.sourceDirectory', value: 'DefaultWorkingDirectory', secret: false },
12
- { name: 'user.profile.name.first', value: 'firstName', secret: false },
13
- { name: 'user.profile', value: 'replace_all', secret: false },
14
- { name: 'constructor.name', value: 'newConstructorName', secret: false },
15
- { name: 'constructor.valueOf', value: 'constructorNewValue', secret: false },
16
- { name: 'systemsettings.appurl', value: 'https://dev.azure.com/helloworld', secret: false }
17
- ]);
18
- var jsonObject = {
19
- 'User.Profile': 'do_not_replace',
20
- 'data': {
21
- 'ConnectionString': 'connect_string',
22
- 'userName': 'name',
23
- 'password': 'pass'
24
- },
25
- '&pl': {
26
- 'ch@r@cter.k^y': 'v@lue'
27
- },
28
- 'system': {
29
- 'debug': 'no_change'
30
- },
31
- 'user.profile': {
32
- 'name.first': 'fname'
33
- },
34
- 'constructor.name': 'myconstructorname',
35
- 'constructor': {
36
- 'name': 'myconstructorname',
37
- 'valueOf': 'myconstructorvalue'
38
- },
39
- 'systemsettings': {
40
- 'appurl': 'https://helloworld.visualstudio.com'
41
- }
42
- };
43
- // Method to be checked for JSON variable substitution
44
- jsonSubUtil.substituteJsonVariable(jsonObject, envVarObject);
45
- if (typeof jsonObject['user.profile'] === 'object') {
46
- console.log('JSON - eliminating object variables validated');
3
+ exports.runL1JsonVarSubTests = void 0;
4
+ const assert = require("assert");
5
+ const jsonvariablesubstitutionutility_1 = require("../jsonvariablesubstitutionutility");
6
+ function runL1JsonVarSubTests() {
7
+ it("Should substitute JSON variables", (done) => {
8
+ const envVarObject = jsonvariablesubstitutionutility_1.createEnvTree([
9
+ { name: 'system.debug', value: 'true', secret: false },
10
+ { name: 'data.ConnectionString', value: 'database_connection', secret: false },
11
+ { name: 'data.userName', value: 'db_admin', secret: false },
12
+ { name: 'data.password', value: 'db_pass', secret: true },
13
+ { name: '&pl.ch@r@cter.k^y', value: '*.config', secret: false },
14
+ { name: 'build.sourceDirectory', value: 'DefaultWorkingDirectory', secret: false },
15
+ { name: 'user.profile.name.first', value: 'firstName', secret: false },
16
+ { name: 'user.profile', value: 'replace_all', secret: false },
17
+ { name: 'constructor.name', value: 'newConstructorName', secret: false },
18
+ { name: 'constructor.valueOf', value: 'constructorNewValue', secret: false },
19
+ { name: 'systemsettings.appurl', value: 'https://dev.azure.com/helloworld', secret: false }
20
+ ]);
21
+ const jsonObject = {
22
+ 'User.Profile': 'do_not_replace',
23
+ 'data': {
24
+ 'ConnectionString': 'connect_string',
25
+ 'userName': 'name',
26
+ 'password': 'pass'
27
+ },
28
+ '&pl': {
29
+ 'ch@r@cter.k^y': 'v@lue'
30
+ },
31
+ 'system': {
32
+ 'debug': 'no_change'
33
+ },
34
+ 'user.profile': {
35
+ 'name.first': 'fname'
36
+ },
37
+ 'constructor.name': 'myconstructorname',
38
+ 'constructor': {
39
+ 'name': 'myconstructorname',
40
+ 'valueOf': 'myconstructorvalue'
41
+ },
42
+ 'systemsettings': {
43
+ 'appurl': 'https://helloworld.visualstudio.com'
44
+ }
45
+ };
46
+ jsonvariablesubstitutionutility_1.substituteJsonVariable(jsonObject, envVarObject);
47
+ assert.strictEqual(typeof jsonObject['user.profile'], 'object');
48
+ assert.strictEqual(jsonObject['data']['ConnectionString'], 'database_connection');
49
+ assert.strictEqual(jsonObject['data']['userName'], 'db_admin');
50
+ assert.strictEqual(jsonObject['systemsettings']['appurl'], 'https://dev.azure.com/helloworld');
51
+ assert.strictEqual(jsonObject['system']['debug'], 'no_change');
52
+ assert.strictEqual(jsonObject['&pl']['ch@r@cter.k^y'], '*.config');
53
+ assert.strictEqual(jsonObject['user.profile']['name.first'], 'firstName');
54
+ assert.strictEqual(jsonObject['User.Profile'], 'do_not_replace');
55
+ assert.strictEqual(jsonObject['constructor.name'], 'newConstructorName');
56
+ assert.strictEqual(jsonObject['constructor']['name'], 'newConstructorName');
57
+ assert.strictEqual(jsonObject['constructor']['valueOf'], 'constructorNewValue');
58
+ done();
59
+ });
47
60
  }
48
- if (jsonObject['data']['ConnectionString'] === 'database_connection'
49
- && jsonObject['data']['userName'] === 'db_admin'
50
- && jsonObject['systemsettings']['appurl'] == 'https://dev.azure.com/helloworld') {
51
- console.log('JSON - simple string change validated');
52
- }
53
- if (jsonObject['system']['debug'] === 'no_change') {
54
- console.log('JSON - system variable elimination validated');
55
- }
56
- if (jsonObject['&pl']['ch@r@cter.k^y'] === '*.config') {
57
- console.log('JSON - special variables validated');
58
- }
59
- if (jsonObject['user.profile']['name.first'] === 'firstName') {
60
- console.log('JSON - variables with dot character validated');
61
- }
62
- if (jsonObject['User.Profile'] === 'do_not_replace') {
63
- console.log('JSON - case sensitive variables validated');
64
- }
65
- if (jsonObject['constructor.name'] === 'newConstructorName' &&
66
- jsonObject['constructor']['name'] === 'newConstructorName' && jsonObject['constructor']['valueOf'] === 'constructorNewValue') {
67
- console.log('JSON - substitute inbuilt JSON attributes validated');
68
- }
69
- L1JSONVarSubWithComments_1.validate();
61
+ exports.runL1JsonVarSubTests = runL1JsonVarSubTests;
@@ -1,71 +1,72 @@
1
- import { validate } from './L1JSONVarSubWithComments';
2
- var jsonSubUtil = require('azure-pipelines-tasks-webdeployment-common/jsonvariablesubstitutionutility.js');
1
+ import * as assert from 'assert';
3
2
 
4
- var envVarObject = jsonSubUtil.createEnvTree([
5
- { name: 'system.debug', value: 'true', secret: false},
6
- { name: 'data.ConnectionString', value: 'database_connection', secret: false},
7
- { name: 'data.userName', value: 'db_admin', secret: false},
8
- { name: 'data.password', value: 'db_pass', secret: true},
9
- { name: '&pl.ch@r@cter.k^y', value: '*.config', secret: false},
10
- { name: 'build.sourceDirectory', value: 'DefaultWorkingDirectory', secret: false},
11
- { name: 'user.profile.name.first', value: 'firstName', secret: false},
12
- { name: 'user.profile', value: 'replace_all', secret: false},
13
- { name: 'constructor.name', value: 'newConstructorName', secret: false},
14
- { name: 'constructor.valueOf', value: 'constructorNewValue', secret: false},
15
- { name: 'systemsettings.appurl', value: 'https://dev.azure.com/helloworld', secret: false}
16
- ]);
3
+ import { createEnvTree, substituteJsonVariable } from '../jsonvariablesubstitutionutility';
17
4
 
18
- var jsonObject = {
19
- 'User.Profile': 'do_not_replace',
20
- 'data': {
21
- 'ConnectionString' : 'connect_string',
22
- 'userName': 'name',
23
- 'password': 'pass'
24
- },
25
- '&pl': {
26
- 'ch@r@cter.k^y': 'v@lue'
27
- },
28
- 'system': {
29
- 'debug' : 'no_change'
30
- },
31
- 'user.profile': {
32
- 'name.first' : 'fname'
33
- },
34
- 'constructor.name': 'myconstructorname',
35
- 'constructor': {
36
- 'name': 'myconstructorname',
37
- 'valueOf': 'myconstructorvalue'
38
- },
39
- 'systemsettings': {
40
- 'appurl': 'https://helloworld.visualstudio.com'
41
- }
42
- }
43
- // Method to be checked for JSON variable substitution
44
- jsonSubUtil.substituteJsonVariable(jsonObject, envVarObject);
45
5
 
46
- if(typeof jsonObject['user.profile'] === 'object') {
47
- console.log('JSON - eliminating object variables validated');
48
- }
49
- if(jsonObject['data']['ConnectionString'] === 'database_connection'
50
- && jsonObject['data']['userName'] === 'db_admin'
51
- && jsonObject['systemsettings']['appurl'] == 'https://dev.azure.com/helloworld') {
52
- console.log('JSON - simple string change validated');
53
- }
54
- if(jsonObject['system']['debug'] === 'no_change') {
55
- console.log('JSON - system variable elimination validated');
56
- }
57
- if(jsonObject['&pl']['ch@r@cter.k^y'] === '*.config') {
58
- console.log('JSON - special variables validated');
59
- }
60
- if(jsonObject['user.profile']['name.first'] === 'firstName') {
61
- console.log('JSON - variables with dot character validated');
62
- }
63
- if(jsonObject['User.Profile'] === 'do_not_replace') {
64
- console.log('JSON - case sensitive variables validated');
65
- }
66
- if(jsonObject['constructor.name'] === 'newConstructorName' &&
67
- jsonObject['constructor']['name'] === 'newConstructorName' && jsonObject['constructor']['valueOf'] === 'constructorNewValue') {
68
- console.log('JSON - substitute inbuilt JSON attributes validated');
6
+ export function runL1JsonVarSubTests(): void {
7
+
8
+ it("Should substitute JSON variables", (done: Mocha.Done) => {
9
+ const envVarObject = createEnvTree([
10
+ { name: 'system.debug', value: 'true', secret: false },
11
+ { name: 'data.ConnectionString', value: 'database_connection', secret: false },
12
+ { name: 'data.userName', value: 'db_admin', secret: false },
13
+ { name: 'data.password', value: 'db_pass', secret: true },
14
+ { name: '&pl.ch@r@cter.k^y', value: '*.config', secret: false },
15
+ { name: 'build.sourceDirectory', value: 'DefaultWorkingDirectory', secret: false },
16
+ { name: 'user.profile.name.first', value: 'firstName', secret: false },
17
+ { name: 'user.profile', value: 'replace_all', secret: false },
18
+ { name: 'constructor.name', value: 'newConstructorName', secret: false },
19
+ { name: 'constructor.valueOf', value: 'constructorNewValue', secret: false },
20
+ { name: 'systemsettings.appurl', value: 'https://dev.azure.com/helloworld', secret: false }
21
+ ]);
22
+
23
+ const jsonObject = {
24
+ 'User.Profile': 'do_not_replace',
25
+ 'data': {
26
+ 'ConnectionString': 'connect_string',
27
+ 'userName': 'name',
28
+ 'password': 'pass'
29
+ },
30
+ '&pl': {
31
+ 'ch@r@cter.k^y': 'v@lue'
32
+ },
33
+ 'system': {
34
+ 'debug': 'no_change'
35
+ },
36
+ 'user.profile': {
37
+ 'name.first': 'fname'
38
+ },
39
+ 'constructor.name': 'myconstructorname',
40
+ 'constructor': {
41
+ 'name': 'myconstructorname',
42
+ 'valueOf': 'myconstructorvalue'
43
+ },
44
+ 'systemsettings': {
45
+ 'appurl': 'https://helloworld.visualstudio.com'
46
+ }
47
+ };
48
+
49
+ substituteJsonVariable(jsonObject, envVarObject);
50
+
51
+ assert.strictEqual(typeof jsonObject['user.profile'], 'object');
52
+ assert.strictEqual(jsonObject['data']['ConnectionString'], 'database_connection');
53
+ assert.strictEqual(jsonObject['data']['userName'], 'db_admin');
54
+ assert.strictEqual(jsonObject['systemsettings']['appurl'], 'https://dev.azure.com/helloworld');
55
+ assert.strictEqual(jsonObject['system']['debug'], 'no_change');
56
+ assert.strictEqual(jsonObject['&pl']['ch@r@cter.k^y'], '*.config');
57
+ assert.strictEqual(jsonObject['user.profile']['name.first'], 'firstName');
58
+ assert.strictEqual(jsonObject['User.Profile'], 'do_not_replace');
59
+ assert.strictEqual(jsonObject['constructor.name'], 'newConstructorName');
60
+ assert.strictEqual(jsonObject['constructor']['name'], 'newConstructorName');
61
+ assert.strictEqual(jsonObject['constructor']['valueOf'], 'constructorNewValue');
62
+
63
+ done();
64
+ });
65
+
69
66
  }
70
67
 
71
- validate();
68
+
69
+
70
+
71
+
72
+
@@ -1 +1 @@
1
- export {};
1
+ export declare function runL1JsonVarSubV2Tests(): void;
@@ -1,97 +1,86 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const L1JSONVarSubWithComments_1 = require("./L1JSONVarSubWithComments");
4
- var jsonSubUtil = require('azure-pipelines-tasks-webdeployment-common/jsonvariablesubstitutionutility.js');
5
- var envVarObject = jsonSubUtil.createEnvTree([
6
- { name: 'system.debug', value: 'true', secret: false },
7
- { name: 'data.ConnectionString', value: 'database_connection', secret: false },
8
- { name: 'data.userName', value: 'db_admin', secret: false },
9
- { name: 'data.password', value: 'db_pass', secret: true },
10
- { name: '&pl.ch@r@cter.k^y', value: '*.config', secret: false },
11
- { name: 'build.sourceDirectory', value: 'DefaultWorkingDirectory', secret: false },
12
- { name: 'user.profile.name.first', value: 'firstName', secret: false },
13
- { name: 'user.profile', value: 'replace_all', secret: false },
14
- { name: 'constructor.name', value: 'newConstructorName', secret: false },
15
- { name: 'constructor.valueOf', value: 'constructorNewValue', secret: false },
16
- { name: 'profile.users', value: '["suaggar","rok","asranja", "chaitanya"]', secret: false },
17
- { name: 'profile.enabled', value: 'false', secret: false },
18
- { name: 'profile.version', value: '1173', secret: false },
19
- { name: 'profile.somefloat', value: '97.75', secret: false },
20
- { name: 'profile.preimum_level', value: '{"suaggar": "V4", "rok": "V5", "asranja": { "type" : "V6"}}', secret: false },
21
- { name: 'systemsettings.appurl', value: 'https://dev.azure.com/helloworld', secret: false }
22
- ]);
23
- var jsonObject = {
24
- 'User.Profile': 'do_not_replace',
25
- 'data': {
26
- 'ConnectionString': 'connect_string',
27
- 'userName': 'name',
28
- 'password': 'pass'
29
- },
30
- '&pl': {
31
- 'ch@r@cter.k^y': 'v@lue'
32
- },
33
- 'system': {
34
- 'debug': 'no_change'
35
- },
36
- 'user.profile': {
37
- 'name.first': 'fname'
38
- },
39
- 'constructor.name': 'myconstructorname',
40
- 'constructor': {
41
- 'name': 'myconstructorname',
42
- 'valueOf': 'myconstructorvalue'
43
- },
44
- 'profile': {
45
- 'users': ['arjgupta', 'raagra', 'muthuk'],
46
- 'preimum_level': {
47
- 'arjgupta': 'V1',
48
- 'raagra': 'V2',
49
- 'muthuk': {
50
- 'type': 'V3'
3
+ exports.runL1JsonVarSubV2Tests = void 0;
4
+ const assert = require("assert");
5
+ const jsonvariablesubstitutionutility_1 = require("../jsonvariablesubstitutionutility");
6
+ function runL1JsonVarSubV2Tests() {
7
+ it("Should substitute JSON variables V2", (done) => {
8
+ const envVarObject = jsonvariablesubstitutionutility_1.createEnvTree([
9
+ { name: 'system.debug', value: 'true', secret: false },
10
+ { name: 'data.ConnectionString', value: 'database_connection', secret: false },
11
+ { name: 'data.userName', value: 'db_admin', secret: false },
12
+ { name: 'data.password', value: 'db_pass', secret: true },
13
+ { name: '&pl.ch@r@cter.k^y', value: '*.config', secret: false },
14
+ { name: 'build.sourceDirectory', value: 'DefaultWorkingDirectory', secret: false },
15
+ { name: 'user.profile.name.first', value: 'firstName', secret: false },
16
+ { name: 'user.profile', value: 'replace_all', secret: false },
17
+ { name: 'constructor.name', value: 'newConstructorName', secret: false },
18
+ { name: 'constructor.valueOf', value: 'constructorNewValue', secret: false },
19
+ { name: 'profile.users', value: '["suaggar","rok","asranja", "chaitanya"]', secret: false },
20
+ { name: 'profile.enabled', value: 'false', secret: false },
21
+ { name: 'profile.version', value: '1173', secret: false },
22
+ { name: 'profile.somefloat', value: '97.75', secret: false },
23
+ { name: 'profile.preimum_level', value: '{"suaggar": "V4", "rok": "V5", "asranja": { "type" : "V6"}}', secret: false },
24
+ { name: 'systemsettings.appurl', value: 'https://dev.azure.com/helloworld', secret: false }
25
+ ]);
26
+ const jsonObject = {
27
+ 'User.Profile': 'do_not_replace',
28
+ 'data': {
29
+ 'ConnectionString': 'connect_string',
30
+ 'userName': 'name',
31
+ 'password': 'pass'
32
+ },
33
+ '&pl': {
34
+ 'ch@r@cter.k^y': 'v@lue'
35
+ },
36
+ 'system': {
37
+ 'debug': 'no_change'
38
+ },
39
+ 'user.profile': {
40
+ 'name.first': 'fname'
41
+ },
42
+ 'constructor.name': 'myconstructorname',
43
+ 'constructor': {
44
+ 'name': 'myconstructorname',
45
+ 'valueOf': 'myconstructorvalue'
46
+ },
47
+ 'profile': {
48
+ 'users': ['arjgupta', 'raagra', 'muthuk'],
49
+ 'preimum_level': {
50
+ 'arjgupta': 'V1',
51
+ 'raagra': 'V2',
52
+ 'muthuk': {
53
+ 'type': 'V3'
54
+ }
55
+ },
56
+ "enabled": true,
57
+ "version": 2,
58
+ "somefloat": 2.3456
59
+ },
60
+ 'systemsettings': {
61
+ 'appurl': 'https://helloworld.visualstudio.com'
51
62
  }
52
- },
53
- "enabled": true,
54
- "version": 2,
55
- "somefloat": 2.3456
56
- },
57
- 'systemsettings': {
58
- 'appurl': 'https://helloworld.visualstudio.com'
59
- }
60
- };
61
- // Method to be checked for JSON variable substitution
62
- jsonSubUtil.substituteJsonVariableV2(jsonObject, envVarObject);
63
- if (jsonObject['data']['ConnectionString'] === 'database_connection'
64
- && jsonObject['data']['userName'] === 'db_admin'
65
- && jsonObject['systemsettings']['appurl'] == 'https://dev.azure.com/helloworld') {
66
- console.log('JSON - simple string change validated');
63
+ };
64
+ jsonvariablesubstitutionutility_1.substituteJsonVariableV2(jsonObject, envVarObject);
65
+ assert.strictEqual(jsonObject['data']['ConnectionString'], 'database_connection');
66
+ assert.strictEqual(jsonObject['data']['userName'], 'db_admin');
67
+ assert.strictEqual(jsonObject['systemsettings']['appurl'], 'https://dev.azure.com/helloworld');
68
+ assert.strictEqual(jsonObject['system']['debug'], 'no_change');
69
+ assert.strictEqual(jsonObject['&pl']['ch@r@cter.k^y'], '*.config');
70
+ assert.strictEqual(jsonObject['User.Profile'], 'do_not_replace');
71
+ assert.strictEqual(jsonObject['constructor.name'], 'newConstructorName');
72
+ assert.strictEqual(jsonObject['constructor']['name'], 'newConstructorName');
73
+ assert.strictEqual(jsonObject['constructor']['valueOf'], 'constructorNewValue');
74
+ assert.strictEqual(jsonObject['profile']['users'].length, 4);
75
+ assert.notStrictEqual(jsonObject['profile']['users'].indexOf('suaggar'), -1);
76
+ assert.notStrictEqual(jsonObject['profile']['users'].indexOf('rok'), -1);
77
+ assert.notStrictEqual(jsonObject['profile']['users'].indexOf('asranja'), -1);
78
+ assert.notStrictEqual(jsonObject['profile']['users'].indexOf('chaitanya'), -1);
79
+ assert.strictEqual(jsonObject['profile']['enabled'], false);
80
+ assert.strictEqual(jsonObject['profile']['somefloat'], 97.75);
81
+ assert.strictEqual(jsonObject['profile']['version'], 1173);
82
+ assert.deepStrictEqual(jsonObject['profile']['preimum_level'], { suaggar: "V4", rok: "V5", asranja: { type: "V6" } });
83
+ done();
84
+ });
67
85
  }
68
- if (jsonObject['system']['debug'] === 'no_change') {
69
- console.log('JSON - system variable elimination validated');
70
- }
71
- if (jsonObject['&pl']['ch@r@cter.k^y'] === '*.config') {
72
- console.log('JSON - special variables validated');
73
- }
74
- if (jsonObject['User.Profile'] === 'do_not_replace') {
75
- console.log('JSON - case sensitive variables validated');
76
- }
77
- if (jsonObject['constructor.name'] === 'newConstructorName' &&
78
- jsonObject['constructor']['name'] === 'newConstructorName' && jsonObject['constructor']['valueOf'] === 'constructorNewValue') {
79
- console.log('JSON - substitute inbuilt JSON attributes validated');
80
- }
81
- let newArray = ["suaggar", "rok", "asranja", "chaitanya"];
82
- if (jsonObject['profile']['users'].length == 4 && (jsonObject['profile']['users']).every((value, index) => { return value == newArray[index]; })) {
83
- console.log('JSON - Array Object validated');
84
- }
85
- if (jsonObject['profile']['enabled'] == false) {
86
- console.log('JSON - Boolean validated');
87
- }
88
- if (jsonObject['profile']['somefloat'] == 97.75) {
89
- console.log('JSON - Number(float) validated');
90
- }
91
- if (jsonObject['profile']['version'] == 1173) {
92
- console.log('JSON - Number(int) validated');
93
- }
94
- if (JSON.stringify(jsonObject['profile']['preimum_level']) == JSON.stringify({ "suaggar": "V4", "rok": "V5", "asranja": { "type": "V6" } })) {
95
- console.log('JSON - Object validated');
96
- }
97
- L1JSONVarSubWithComments_1.validate();
86
+ exports.runL1JsonVarSubV2Tests = runL1JsonVarSubV2Tests;