@fincity/kirun-js 1.0.5 → 1.1.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 (118) hide show
  1. package/__tests__/engine/function/system/array/AddFirstTest.ts +13 -12
  2. package/__tests__/engine/function/system/array/AddTest.ts +11 -11
  3. package/__tests__/engine/function/system/array/BinarySearchTest.ts +29 -14
  4. package/__tests__/engine/function/system/array/CompareTest.ts +3 -3
  5. package/__tests__/engine/function/system/array/CopyTest.ts +5 -5
  6. package/__tests__/engine/function/system/array/DeleteFirstTest.ts +10 -10
  7. package/__tests__/engine/function/system/array/DeleteFromTest.ts +8 -8
  8. package/__tests__/engine/function/system/array/DeleteLastTest.ts +10 -10
  9. package/__tests__/engine/function/system/array/DeleteTest.ts +60 -25
  10. package/__tests__/engine/function/system/array/DisjointTest.ts +6 -7
  11. package/__tests__/engine/function/system/array/Equals.ts +5 -5
  12. package/__tests__/engine/function/system/array/FillTest.ts +5 -5
  13. package/__tests__/engine/function/system/array/FrequencyTest.ts +11 -11
  14. package/__tests__/engine/function/system/array/IndexOfArrayTest.ts +14 -20
  15. package/__tests__/engine/function/system/array/IndexOfTest.ts +26 -14
  16. package/__tests__/engine/function/system/array/InsertTest.ts +12 -12
  17. package/__tests__/engine/function/system/array/LastIndexOfArrayTest.ts +9 -12
  18. package/__tests__/engine/function/system/array/LastIndexOfTest.ts +16 -16
  19. package/__tests__/engine/function/system/array/MaxTest.ts +18 -18
  20. package/__tests__/engine/function/system/array/MinTest.ts +18 -18
  21. package/__tests__/engine/function/system/array/MisMatchTest.ts +8 -11
  22. package/__tests__/engine/function/system/array/ReverseTest.ts +12 -12
  23. package/__tests__/engine/function/system/array/RotateTest.ts +6 -6
  24. package/__tests__/engine/function/system/array/ShuffleTest.ts +7 -4
  25. package/__tests__/engine/function/system/array/SortTest.ts +10 -10
  26. package/__tests__/engine/function/system/array/SubArrayTest.ts +19 -10
  27. package/__tests__/engine/function/system/context/SetFunctionTest.ts +24 -5
  28. package/__tests__/engine/function/system/math/AddTest.ts +2 -2
  29. package/__tests__/engine/function/system/math/RandomIntTest.ts +46 -0
  30. package/__tests__/engine/function/system/string/ConcatenateTest.ts +4 -4
  31. package/__tests__/engine/function/system/string/DeleteForGivenLengthTest.ts +8 -4
  32. package/__tests__/engine/function/system/string/InsertAtGivenPositionTest.ts +6 -6
  33. package/__tests__/engine/function/system/string/PostPadTest.ts +6 -6
  34. package/__tests__/engine/function/system/string/PrePadTest.ts +8 -8
  35. package/__tests__/engine/function/system/string/RegionMatchesTest.ts +15 -6
  36. package/__tests__/engine/function/system/string/ReverseTest.ts +6 -6
  37. package/__tests__/engine/function/system/string/SplitTest.ts +8 -4
  38. package/__tests__/engine/function/system/string/StringFunctionRepoTest2.ts +35 -11
  39. package/__tests__/engine/function/system/string/StringFunctionRepoTest3.ts +14 -5
  40. package/__tests__/engine/function/system/string/StringFunctionRepositoryTest.ts +40 -16
  41. package/__tests__/engine/function/system/string/ToStringTest.ts +6 -6
  42. package/__tests__/engine/function/system/string/TrimToTest.ts +8 -6
  43. package/__tests__/engine/runtime/KIRuntimeTest.ts +148 -155
  44. package/__tests__/engine/runtime/KIRuntimeWithDefinitionTest.ts +89 -0
  45. package/__tests__/engine/util/LinkedListTest.ts +9 -0
  46. package/dist/index.js +1 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/module.js +1 -1
  49. package/dist/module.js.map +1 -1
  50. package/dist/types.d.ts +267 -109
  51. package/dist/types.d.ts.map +1 -1
  52. package/package.json +1 -1
  53. package/src/engine/function/AbstractFunction.ts +5 -3
  54. package/src/engine/function/Function.ts +1 -1
  55. package/src/engine/function/system/GenerateEvent.ts +1 -1
  56. package/src/engine/function/system/If.ts +1 -1
  57. package/src/engine/function/system/array/AbstractArrayFunction.ts +5 -0
  58. package/src/engine/function/system/array/Add.ts +1 -1
  59. package/src/engine/function/system/array/AddFirst.ts +1 -1
  60. package/src/engine/function/system/array/BinarySearch.ts +1 -1
  61. package/src/engine/function/system/array/Compare.ts +1 -1
  62. package/src/engine/function/system/array/Copy.ts +1 -1
  63. package/src/engine/function/system/array/Delete.ts +24 -32
  64. package/src/engine/function/system/array/DeleteFirst.ts +1 -1
  65. package/src/engine/function/system/array/DeleteFrom.ts +1 -1
  66. package/src/engine/function/system/array/DeleteLast.ts +1 -1
  67. package/src/engine/function/system/array/Disjoint.ts +1 -1
  68. package/src/engine/function/system/array/Equals.ts +2 -2
  69. package/src/engine/function/system/array/Fill.ts +1 -1
  70. package/src/engine/function/system/array/Frequency.ts +1 -1
  71. package/src/engine/function/system/array/IndexOf.ts +1 -1
  72. package/src/engine/function/system/array/IndexOfArray.ts +1 -1
  73. package/src/engine/function/system/array/Insert.ts +1 -1
  74. package/src/engine/function/system/array/LastIndexOf.ts +1 -1
  75. package/src/engine/function/system/array/LastIndexOfArray.ts +1 -1
  76. package/src/engine/function/system/array/Max.ts +1 -1
  77. package/src/engine/function/system/array/Min.ts +1 -1
  78. package/src/engine/function/system/array/MisMatch.ts +1 -1
  79. package/src/engine/function/system/array/Reverse.ts +1 -1
  80. package/src/engine/function/system/array/Rotate.ts +1 -1
  81. package/src/engine/function/system/array/Shuffle.ts +1 -1
  82. package/src/engine/function/system/array/Sort.ts +1 -1
  83. package/src/engine/function/system/array/SubArray.ts +1 -1
  84. package/src/engine/function/system/context/Create.ts +1 -1
  85. package/src/engine/function/system/context/Get.ts +1 -1
  86. package/src/engine/function/system/context/SetFunction.ts +1 -1
  87. package/src/engine/function/system/loop/CountLoop.ts +1 -1
  88. package/src/engine/function/system/loop/RangeLoop.ts +1 -1
  89. package/src/engine/function/system/math/Add.ts +2 -4
  90. package/src/engine/function/system/math/GenericMathFunction.ts +2 -4
  91. package/src/engine/function/system/math/Hypotenuse.ts +2 -6
  92. package/src/engine/function/system/math/Maximum.ts +2 -4
  93. package/src/engine/function/system/math/Minimum.ts +2 -4
  94. package/src/engine/function/system/math/Random.ts +1 -1
  95. package/src/engine/function/system/math/RandomFloat.ts +56 -0
  96. package/src/engine/function/system/math/RandomInt.ts +56 -0
  97. package/src/engine/function/system/string/AbstractStringFunction.ts +24 -8
  98. package/src/engine/function/system/string/Concatenate.ts +2 -2
  99. package/src/engine/function/system/string/DeleteForGivenLength.ts +25 -15
  100. package/src/engine/function/system/string/InsertAtGivenPosition.ts +17 -7
  101. package/src/engine/function/system/string/PostPad.ts +20 -10
  102. package/src/engine/function/system/string/PrePad.ts +17 -7
  103. package/src/engine/function/system/string/RegionMatches.ts +40 -22
  104. package/src/engine/function/system/string/ReplaceAtGivenPosition.ts +26 -13
  105. package/src/engine/function/system/string/Reverse.ts +4 -3
  106. package/src/engine/function/system/string/Split.ts +13 -4
  107. package/src/engine/function/system/string/ToString.ts +9 -5
  108. package/src/engine/function/system/string/TrimTo.ts +13 -6
  109. package/src/engine/json/schema/Schema.ts +1 -0
  110. package/src/engine/model/Event.ts +15 -0
  111. package/src/engine/model/FunctionDefinition.ts +76 -29
  112. package/src/engine/model/Parameter.ts +11 -0
  113. package/src/engine/model/ParameterReference.ts +8 -1
  114. package/src/engine/model/Position.ts +5 -0
  115. package/src/engine/model/Statement.ts +16 -0
  116. package/src/engine/model/StatementGroup.ts +7 -0
  117. package/src/engine/runtime/KIRuntime.ts +26 -24
  118. package/src/index.ts +71 -20
@@ -6,7 +6,7 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
6
6
 
7
7
  const stringRepo = new StringFunctionRepository();
8
8
 
9
- test('StringRepo - contains', () => {
9
+ test('StringRepo - contains', async () => {
10
10
  let fun = stringRepo.find(Namespaces.STRING, 'Contains');
11
11
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
12
12
 
@@ -23,7 +23,10 @@ test('StringRepo - contains', () => {
23
23
  ),
24
24
  );
25
25
  expect(
26
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
26
+ (await fun.execute(fep))
27
+ .allResults()[0]
28
+ .getResult()
29
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
27
30
  ).toBe(true);
28
31
 
29
32
  fep.setArguments(
@@ -35,7 +38,10 @@ test('StringRepo - contains', () => {
35
38
  ),
36
39
  );
37
40
  expect(
38
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
41
+ (await fun.execute(fep))
42
+ .allResults()[0]
43
+ .getResult()
44
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
39
45
  ).toBe(true);
40
46
 
41
47
  fep.setArguments(
@@ -48,7 +54,10 @@ test('StringRepo - contains', () => {
48
54
  );
49
55
 
50
56
  expect(
51
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
57
+ (await fun.execute(fep))
58
+ .allResults()[0]
59
+ .getResult()
60
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
52
61
  ).toBe(true);
53
62
 
54
63
  fep.setArguments(
@@ -61,11 +70,14 @@ test('StringRepo - contains', () => {
61
70
  );
62
71
 
63
72
  expect(
64
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
73
+ (await fun.execute(fep))
74
+ .allResults()[0]
75
+ .getResult()
76
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
65
77
  ).toBe(false);
66
78
  });
67
79
 
68
- test('string function repo 2', () => {
80
+ test('string function repo 2', async () => {
69
81
  let fun = stringRepo.find(Namespaces.STRING, 'EndsWith');
70
82
 
71
83
  if (!fun) {
@@ -82,7 +94,10 @@ test('string function repo 2', () => {
82
94
  ),
83
95
  );
84
96
  expect(
85
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
97
+ (await fun.execute(fep))
98
+ .allResults()[0]
99
+ .getResult()
100
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
86
101
  ).toBe(true);
87
102
 
88
103
  fep.setArguments(
@@ -95,7 +110,10 @@ test('string function repo 2', () => {
95
110
  );
96
111
 
97
112
  expect(
98
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
113
+ (await fun.execute(fep))
114
+ .allResults()[0]
115
+ .getResult()
116
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
99
117
  ).toBe(true);
100
118
 
101
119
  fep.setArguments(
@@ -108,11 +126,14 @@ test('string function repo 2', () => {
108
126
  );
109
127
 
110
128
  expect(
111
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
129
+ (await fun.execute(fep))
130
+ .allResults()[0]
131
+ .getResult()
132
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
112
133
  ).toBe(true);
113
134
  });
114
135
 
115
- test('string function repo 3', () => {
136
+ test('string function repo 3', async () => {
116
137
  let fun = stringRepo.find(Namespaces.STRING, 'EndsWith');
117
138
 
118
139
  if (!fun) {
@@ -131,6 +152,9 @@ test('string function repo 3', () => {
131
152
  );
132
153
 
133
154
  expect(
134
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
155
+ (await fun.execute(fep))
156
+ .allResults()[0]
157
+ .getResult()
158
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
135
159
  ).toBe(false);
136
160
  });
@@ -6,7 +6,7 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
6
6
 
7
7
  const stringRepo = new StringFunctionRepository();
8
8
 
9
- test('StringRepo3 - EqualsIgnoreCase', () => {
9
+ test('StringRepo3 - EqualsIgnoreCase', async () => {
10
10
  let fun = stringRepo.find(Namespaces.STRING, 'EqualsIgnoreCase');
11
11
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
12
12
 
@@ -23,7 +23,10 @@ test('StringRepo3 - EqualsIgnoreCase', () => {
23
23
  ),
24
24
  );
25
25
  expect(
26
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
26
+ (await fun.execute(fep))
27
+ .allResults()[0]
28
+ .getResult()
29
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
27
30
  ).toBeTruthy();
28
31
 
29
32
  fep.setArguments(
@@ -36,11 +39,14 @@ test('StringRepo3 - EqualsIgnoreCase', () => {
36
39
  );
37
40
 
38
41
  expect(
39
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
42
+ (await fun.execute(fep))
43
+ .allResults()[0]
44
+ .getResult()
45
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
40
46
  ).toBeFalsy();
41
47
  });
42
48
 
43
- test('StringRepo3 - EqualsIgnoreCase', () => {
49
+ test('StringRepo3 - EqualsIgnoreCase', async () => {
44
50
  let fun = stringRepo.find(Namespaces.STRING, 'EqualsIgnoreCase');
45
51
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
46
52
  new Map([
@@ -57,6 +63,9 @@ test('StringRepo3 - EqualsIgnoreCase', () => {
57
63
  }
58
64
 
59
65
  expect(
60
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
66
+ (await fun.execute(fep))
67
+ .allResults()[0]
68
+ .getResult()
69
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
61
70
  ).toBe(true);
62
71
  });
@@ -6,7 +6,7 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
6
6
 
7
7
  const repo = new StringFunctionRepository();
8
8
 
9
- test('StringFunctionRepository - Trim', () => {
9
+ test('StringFunctionRepository - Trim', async () => {
10
10
  let fun = repo.find(Namespaces.STRING, 'Trim');
11
11
  if (!fun) {
12
12
  throw new Error('Function not available');
@@ -14,11 +14,14 @@ test('StringFunctionRepository - Trim', () => {
14
14
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
15
15
  fep.setArguments(MapUtil.of(AbstractStringFunction.PARAMETER_STRING_NAME, ' Kiran '));
16
16
  expect(
17
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
17
+ (await fun.execute(fep))
18
+ .allResults()[0]
19
+ .getResult()
20
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
18
21
  ).toBe('Kiran');
19
22
  });
20
23
 
21
- test('StringFunctionRepo -Repeat', () => {
24
+ test('StringFunctionRepo -Repeat', async () => {
22
25
  let fun = repo.find(Namespaces.STRING, 'Repeat');
23
26
  if (!fun) {
24
27
  throw new Error('Function not available');
@@ -35,11 +38,14 @@ test('StringFunctionRepo -Repeat', () => {
35
38
  );
36
39
 
37
40
  expect(
38
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
41
+ (await fun.execute(fep))
42
+ .allResults()[0]
43
+ .getResult()
44
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
39
45
  ).toBe(' surendhar surendhar surendhar ');
40
46
  });
41
47
 
42
- test('StringFunctionRepo -Lowercase', () => {
48
+ test('StringFunctionRepo -Lowercase', async () => {
43
49
  let fun = repo.find(Namespaces.STRING, 'LowerCase');
44
50
  if (!fun) {
45
51
  throw new Error('Function not available');
@@ -55,11 +61,14 @@ test('StringFunctionRepo -Lowercase', () => {
55
61
  );
56
62
 
57
63
  expect(
58
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
64
+ (await fun.execute(fep))
65
+ .allResults()[0]
66
+ .getResult()
67
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
59
68
  ).toBe(' surendhar ');
60
69
  });
61
70
 
62
- test('StringFunctionRepo -UpperCase', () => {
71
+ test('StringFunctionRepo -UpperCase', async () => {
63
72
  let fun = repo.find(Namespaces.STRING, 'UpperCase');
64
73
  if (!fun) {
65
74
  throw new Error('Function not available');
@@ -74,11 +83,14 @@ test('StringFunctionRepo -UpperCase', () => {
74
83
  );
75
84
 
76
85
  expect(
77
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
86
+ (await fun.execute(fep))
87
+ .allResults()[0]
88
+ .getResult()
89
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
78
90
  ).toBe(' SURENDHAR ');
79
91
  });
80
92
 
81
- test('StringFunctionRepo -Blank1', () => {
93
+ test('StringFunctionRepo -Blank1', async () => {
82
94
  let fun = repo.find(Namespaces.STRING, 'IsBlank');
83
95
  if (!fun) {
84
96
  throw new Error('Function not available');
@@ -88,11 +100,14 @@ test('StringFunctionRepo -Blank1', () => {
88
100
  fep.setArguments(MapUtil.of<string, string>(AbstractStringFunction.PARAMETER_STRING_NAME, ''));
89
101
 
90
102
  expect(
91
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
103
+ (await fun.execute(fep))
104
+ .allResults()[0]
105
+ .getResult()
106
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
92
107
  ).toBe(true);
93
108
  });
94
109
 
95
- test('StringFunctionRepo -Blank2', () => {
110
+ test('StringFunctionRepo -Blank2', async () => {
96
111
  let fun = repo.find(Namespaces.STRING, 'IsBlank');
97
112
  if (!fun) {
98
113
  throw new Error('Function not available');
@@ -107,11 +122,14 @@ test('StringFunctionRepo -Blank2', () => {
107
122
  );
108
123
 
109
124
  expect(
110
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
125
+ (await fun.execute(fep))
126
+ .allResults()[0]
127
+ .getResult()
128
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
111
129
  ).toBe(false);
112
130
  });
113
131
 
114
- test('StringFunctionRepo -Empty1', () => {
132
+ test('StringFunctionRepo -Empty1', async () => {
115
133
  let fun = repo.find(Namespaces.STRING, 'IsEmpty');
116
134
  if (!fun) {
117
135
  throw new Error('Function not available');
@@ -123,11 +141,14 @@ test('StringFunctionRepo -Empty1', () => {
123
141
  );
124
142
 
125
143
  expect(
126
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
144
+ (await fun.execute(fep))
145
+ .allResults()[0]
146
+ .getResult()
147
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
127
148
  ).toBe(true);
128
149
  });
129
150
 
130
- test('StringFunctionRepo -Empty2', () => {
151
+ test('StringFunctionRepo -Empty2', async () => {
131
152
  let fun = repo.find(Namespaces.STRING, 'IsEmpty');
132
153
  if (!fun) {
133
154
  throw new Error('Function not available');
@@ -139,6 +160,9 @@ test('StringFunctionRepo -Empty2', () => {
139
160
  );
140
161
 
141
162
  expect(
142
- fun.execute(fep).allResults()[0].getResult().get(AbstractStringFunction.EVENT_RESULT_NAME),
163
+ (await fun.execute(fep))
164
+ .allResults()[0]
165
+ .getResult()
166
+ .get(AbstractStringFunction.EVENT_RESULT_NAME),
143
167
  ).toBe(false);
144
168
  });
@@ -4,14 +4,14 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
4
4
 
5
5
  const toString: ToString = new ToString();
6
6
 
7
- test('toString test1', () => {
7
+ test('toString test1', async () => {
8
8
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
9
9
  fep.setArguments(MapUtil.of('anytype', 123));
10
10
 
11
- expect(toString.execute(fep).allResults()[0].getResult().get('result')).toBe('123');
11
+ expect((await toString.execute(fep)).allResults()[0].getResult().get('result')).toBe('123');
12
12
  });
13
13
 
14
- // test('toString test2', () => {
14
+ // test('toString test2', async () => {
15
15
  // let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
16
16
 
17
17
  // let array: string[] = [];
@@ -30,14 +30,14 @@ test('toString test1', () => {
30
30
 
31
31
  // fep.setArguments(MapUtil.of('anytype', array));
32
32
 
33
- // expect(toString.execute(fep).allResults()[0].getResult().get('result')).toBe(
33
+ // expect((await toString.execute(fep)).allResults()[0].getResult().get('result')).toBe(
34
34
  // 'I am using eclipse to test the changes with test Driven developement',
35
35
  // );
36
36
  // });
37
37
 
38
- test('toString test2 ', () => {
38
+ test('toString test2 ', async () => {
39
39
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
40
40
  fep.setArguments(MapUtil.of('anytype', true));
41
41
 
42
- expect(toString.execute(fep).allResults()[0].getResult().get('result')).toBe('true');
42
+ expect((await toString.execute(fep)).allResults()[0].getResult().get('result')).toBe('true');
43
43
  });
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
3
3
 
4
4
  const trim: TrimTo = new TrimTo();
5
5
 
6
- test('Trim to test1 ', () => {
6
+ test('Trim to test1 ', async () => {
7
7
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
8
8
  new Map<string, string | number>([
9
9
  [TrimTo.PARAMETER_STRING_NAME, ' THIScompatY IS A NOcoDE plATFNORM'],
@@ -11,12 +11,12 @@ test('Trim to test1 ', () => {
11
11
  ]),
12
12
  );
13
13
 
14
- expect(trim.execute(fep).allResults()[0].getResult().get(TrimTo.EVENT_RESULT_NAME)).toBe(
15
- ' THIScompatY I',
16
- );
14
+ expect(
15
+ (await trim.execute(fep)).allResults()[0].getResult().get(TrimTo.EVENT_RESULT_NAME),
16
+ ).toBe(' THIScompatY I');
17
17
  });
18
18
 
19
- test('Trim to test2 ', () => {
19
+ test('Trim to test2 ', async () => {
20
20
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
21
21
  new Map<string, string | number>([
22
22
  [TrimTo.PARAMETER_STRING_NAME, ' THIScompatY IS A NOcoDE plATFNORM'],
@@ -24,5 +24,7 @@ test('Trim to test2 ', () => {
24
24
  ]),
25
25
  );
26
26
 
27
- expect(trim.execute(fep).allResults()[0].getResult().get(TrimTo.EVENT_RESULT_NAME)).toBe('');
27
+ expect(
28
+ (await trim.execute(fep)).allResults()[0].getResult().get(TrimTo.EVENT_RESULT_NAME),
29
+ ).toBe('');
28
30
  });