@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
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
3
3
 
4
4
  let sort: Sort = new Sort();
5
5
 
6
- test('sort test 1', () => {
6
+ test('sort test 1', async () => {
7
7
  let arr: any[] = [];
8
8
 
9
9
  arr.push(12);
@@ -25,10 +25,10 @@ test('sort test 1', () => {
25
25
  res.push(15);
26
26
  res.push(98);
27
27
 
28
- expect(sort.execute(fep).allResults()[0].getResult().get('output')).toStrictEqual(res);
28
+ expect((await sort.execute(fep)).allResults()[0].getResult().get('output')).toStrictEqual(res);
29
29
  });
30
30
 
31
- test('sort test 2', () => {
31
+ test('sort test 2', async () => {
32
32
  let arr: any[] = [];
33
33
 
34
34
  arr.push(12);
@@ -50,10 +50,10 @@ test('sort test 2', () => {
50
50
  res.push(15);
51
51
  res.push(98);
52
52
 
53
- expect(sort.execute(fep).allResults()[0].getResult().get('output')).toStrictEqual(res);
53
+ expect((await sort.execute(fep)).allResults()[0].getResult().get('output')).toStrictEqual(res);
54
54
  });
55
55
 
56
- test('sort test 3', () => {
56
+ test('sort test 3', async () => {
57
57
  let arr: any[] = [];
58
58
  arr.push(12);
59
59
  arr.push(15);
@@ -78,10 +78,10 @@ test('sort test 3', () => {
78
78
  ]),
79
79
  );
80
80
 
81
- expect(sort.execute(fep).allResults()[0].getResult().get('output')).toStrictEqual(res);
81
+ expect((await sort.execute(fep)).allResults()[0].getResult().get('output')).toStrictEqual(res);
82
82
  });
83
83
 
84
- test('sort test 4', () => {
84
+ test('sort test 4', async () => {
85
85
  let a;
86
86
  let arr: any[] = [];
87
87
  arr.push(12);
@@ -112,10 +112,10 @@ test('sort test 4', () => {
112
112
  ]),
113
113
  );
114
114
 
115
- expect(sort.execute(fep).allResults()[0].getResult().get('output')).toStrictEqual(res);
115
+ expect((await sort.execute(fep)).allResults()[0].getResult().get('output')).toStrictEqual(res);
116
116
  });
117
117
 
118
- test('sort test 5', () => {
118
+ test('sort test 5', async () => {
119
119
  let arr: any[] = ['Banana', 'Orange', 'Apple', 'Mango'];
120
120
 
121
121
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
@@ -126,5 +126,5 @@ test('sort test 5', () => {
126
126
  ]),
127
127
  );
128
128
  let res: any[] = ['Banana', 'Apple', 'Mango', 'Orange'];
129
- expect(sort.execute(fep).allResults()[0].getResult().get('output')).toStrictEqual(res);
129
+ expect((await sort.execute(fep)).allResults()[0].getResult().get('output')).toStrictEqual(res);
130
130
  });
@@ -1,7 +1,7 @@
1
1
  import { SubArray } from '../../../../../src/engine/function/system/array/SubArray';
2
2
  import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
3
3
 
4
- test('SubArray of Test 1', () => {
4
+ test('SubArray of Test 1', async () => {
5
5
  let sub: SubArray = new SubArray();
6
6
 
7
7
  let array: any[] = [];
@@ -44,11 +44,14 @@ test('SubArray of Test 1', () => {
44
44
  );
45
45
 
46
46
  expect(
47
- sub.execute(fep).allResults()[0].getResult().get(SubArray.EVENT_RESULT_ARRAY.getName()),
47
+ (await sub.execute(fep))
48
+ .allResults()[0]
49
+ .getResult()
50
+ .get(SubArray.EVENT_RESULT_ARRAY.getName()),
48
51
  ).toStrictEqual(res);
49
52
  });
50
53
 
51
- test('SubArray of Test 2', () => {
54
+ test('SubArray of Test 2', async () => {
52
55
  let sub: SubArray = new SubArray();
53
56
 
54
57
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters()
@@ -62,10 +65,10 @@ test('SubArray of Test 2', () => {
62
65
  .setSteps(new Map([]))
63
66
  .setContext(new Map([]));
64
67
 
65
- expect(() => sub.execute(fep)).toThrow();
68
+ await expect(sub.execute(fep)).rejects.toThrow();
66
69
  });
67
70
 
68
- test('SubArray of Test 5', () => {
71
+ test('SubArray of Test 5', async () => {
69
72
  let sub: SubArray = new SubArray();
70
73
 
71
74
  let array: any[] = [];
@@ -99,11 +102,14 @@ test('SubArray of Test 5', () => {
99
102
  );
100
103
 
101
104
  expect(
102
- sub.execute(fep).allResults()[0].getResult().get(SubArray.EVENT_RESULT_ARRAY.getName()),
105
+ (await sub.execute(fep))
106
+ .allResults()[0]
107
+ .getResult()
108
+ .get(SubArray.EVENT_RESULT_ARRAY.getName()),
103
109
  ).toStrictEqual(res);
104
110
  });
105
111
 
106
- test('SubArray of Test 3', () => {
112
+ test('SubArray of Test 3', async () => {
107
113
  let sub: SubArray = new SubArray();
108
114
 
109
115
  let array: any[] = [];
@@ -136,10 +142,10 @@ test('SubArray of Test 3', () => {
136
142
  ]),
137
143
  );
138
144
 
139
- expect(() => sub.execute(fep)).toThrow();
145
+ await expect(sub.execute(fep)).rejects.toThrow();
140
146
  });
141
147
 
142
- test('SubArray of Test 4', () => {
148
+ test('SubArray of Test 4', async () => {
143
149
  let sub: SubArray = new SubArray();
144
150
 
145
151
  let array1: any[] = [];
@@ -231,6 +237,9 @@ test('SubArray of Test 4', () => {
231
237
  ]),
232
238
  );
233
239
  expect(
234
- sub.execute(fep).allResults()[0].getResult().get(SubArray.EVENT_RESULT_ARRAY.getName()),
240
+ (await sub.execute(fep))
241
+ .allResults()[0]
242
+ .getResult()
243
+ .get(SubArray.EVENT_RESULT_ARRAY.getName()),
235
244
  ).toStrictEqual(res);
236
245
  });
@@ -3,7 +3,7 @@ import { SetFunction } from '../../../../../src/engine/function/system/context/S
3
3
  import { ContextElement } from '../../../../../src/engine/runtime/ContextElement';
4
4
  import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
5
5
 
6
- test('Set function test 1', () => {
6
+ test('Set function test 1', async () => {
7
7
  let setFunction: SetFunction = new SetFunction();
8
8
 
9
9
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
@@ -18,7 +18,7 @@ test('Set function test 1', () => {
18
18
  ]),
19
19
  );
20
20
 
21
- setFunction.execute(fep);
21
+ await setFunction.execute(fep);
22
22
  expect(contextMap.get('a')?.getElement()['b']).toBe(20);
23
23
 
24
24
  fep.setArguments(
@@ -28,11 +28,11 @@ test('Set function test 1', () => {
28
28
  ]),
29
29
  );
30
30
 
31
- setFunction.execute(fep);
31
+ await setFunction.execute(fep);
32
32
  expect(contextMap.get('a')?.getElement()['c'][2].d).toBe(25);
33
33
  });
34
34
 
35
- test('Set function test 2', () => {
35
+ test('Set function test 2', async () => {
36
36
  let setFunction: SetFunction = new SetFunction();
37
37
 
38
38
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
@@ -47,6 +47,25 @@ test('Set function test 2', () => {
47
47
  ]),
48
48
  );
49
49
 
50
- setFunction.execute(fep);
50
+ await setFunction.execute(fep);
51
51
  expect(contextMap.get('a')?.getElement()[1]).toBe(240);
52
52
  });
53
+
54
+ test('Set function test 3', async () => {
55
+ let setFunction: SetFunction = new SetFunction();
56
+
57
+ let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
58
+
59
+ let contextMap: Map<string, ContextElement> = new Map();
60
+ contextMap.set('a', new ContextElement(Schema.ofAny('test'), {}));
61
+ fep.setContext(contextMap);
62
+ fep.setArguments(
63
+ new Map<string, any>([
64
+ ['name', 'Context.a.b[1]'],
65
+ ['value', 240],
66
+ ]),
67
+ );
68
+
69
+ await setFunction.execute(fep);
70
+ expect(contextMap.get('a')?.getElement().b[1]).toBe(240);
71
+ });
@@ -3,10 +3,10 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
3
3
 
4
4
  const add: Add = new Add();
5
5
 
6
- test('add test 1', () => {
6
+ test('add test 1', async () => {
7
7
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
8
8
  new Map([['value', [1, 2, 3, 4, 5, 6, 5.5]]]),
9
9
  );
10
10
 
11
- expect(add.execute(fep).allResults()[0].getResult().get('value')).toBe(26.5);
11
+ expect((await add.execute(fep)).allResults()[0].getResult().get('value')).toBe(26.5);
12
12
  });
@@ -0,0 +1,46 @@
1
+ import { RandomInt } from '../../../../../src/engine/function/system/math/RandomInt';
2
+ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
3
+
4
+ const rand = new RandomInt();
5
+
6
+ test(' rand int 1', async () => {
7
+ let min = 100,
8
+ max = 1000123;
9
+ let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
10
+ new Map([
11
+ ['minValue', min],
12
+ ['maxValue', max],
13
+ ]),
14
+ );
15
+ let num: number = (await rand.execute(fep)).allResults()[0].getResult().get('value');
16
+
17
+ expect(num).toBeLessThanOrEqual(max);
18
+ expect(num).toBeGreaterThanOrEqual(min);
19
+ });
20
+
21
+ test(' rand int 2', async () => {
22
+ let min = 100;
23
+ let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
24
+ new Map([['minValue', min]]),
25
+ );
26
+ let num: number = (await rand.execute(fep)).allResults()[0].getResult().get('value');
27
+
28
+ expect(num).toBeLessThanOrEqual(2147483647);
29
+ expect(num).toBeGreaterThanOrEqual(min);
30
+ });
31
+
32
+ test(' rand int 3', async () => {
33
+ let min = 100,
34
+ max = 101;
35
+ let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
36
+ new Map([
37
+ ['minValue', min],
38
+ ['maxValue', max],
39
+ ]),
40
+ );
41
+ let num: number = (await rand.execute(fep)).allResults()[0].getResult().get('value');
42
+
43
+ console.log(num);
44
+ expect(num).toBeLessThanOrEqual(max);
45
+ expect(num).toBeGreaterThanOrEqual(min);
46
+ });
@@ -4,7 +4,7 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
4
4
 
5
5
  const cat: Concatenate = new Concatenate();
6
6
 
7
- test('conatenate test1', () => {
7
+ test('conatenate test1', async () => {
8
8
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
9
9
 
10
10
  let array: string[] = [];
@@ -23,12 +23,12 @@ test('conatenate test1', () => {
23
23
 
24
24
  fep.setArguments(MapUtil.of('value', array));
25
25
 
26
- expect(cat.execute(fep).allResults()[0].getResult().get('value')).toBe(
26
+ expect((await cat.execute(fep)).allResults()[0].getResult().get('value')).toBe(
27
27
  'I am using eclipse to test the changes with test Driven developement',
28
28
  );
29
29
  });
30
30
 
31
- test('conatenate test2', () => {
31
+ test('conatenate test2', async () => {
32
32
  let list: string[] = [];
33
33
  list.push('no code ');
34
34
  list.push(' Kirun ');
@@ -40,7 +40,7 @@ test('conatenate test2', () => {
40
40
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
41
41
 
42
42
  fep.setArguments(MapUtil.of('value', list));
43
- expect(cat.execute(fep).allResults()[0].getResult().get('value')).toBe(
43
+ expect((await cat.execute(fep)).allResults()[0].getResult().get('value')).toBe(
44
44
  'no code Kirun true "\'this is between the strings qith special characters\'" PLATform 2',
45
45
  );
46
46
  });
@@ -5,7 +5,7 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
5
5
 
6
6
  const deleteT: DeleteForGivenLength = new DeleteForGivenLength();
7
7
 
8
- test('DeleteForGivenLength test1', () => {
8
+ test('DeleteForGivenLength test1', async () => {
9
9
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
10
10
 
11
11
  fep.setArguments(
@@ -18,10 +18,12 @@ test('DeleteForGivenLength test1', () => {
18
18
 
19
19
  let outputString: string = ' THIScompaNOcoDE plATFNORM';
20
20
 
21
- expect(deleteT.execute(fep).allResults()[0].getResult().get('result')).toBe(outputString);
21
+ expect((await deleteT.execute(fep)).allResults()[0].getResult().get('result')).toBe(
22
+ outputString,
23
+ );
22
24
  });
23
25
 
24
- test('DeleteForGivenLength test2', () => {
26
+ test('DeleteForGivenLength test2', async () => {
25
27
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
26
28
 
27
29
  fep.setArguments(
@@ -34,5 +36,7 @@ test('DeleteForGivenLength test2', () => {
34
36
 
35
37
  let outputString: string = ' THItY IS A NOcoDE plATFNORM';
36
38
 
37
- expect(deleteT.execute(fep).allResults()[0].getResult().get('result')).toBe(outputString);
39
+ expect((await deleteT.execute(fep)).allResults()[0].getResult().get('result')).toBe(
40
+ outputString,
41
+ );
38
42
  });
@@ -4,7 +4,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
4
4
 
5
5
  const reve: InsertAtGivenPosition = new InsertAtGivenPosition();
6
6
 
7
- test('InsertATGivenPositions test1', () => {
7
+ test('InsertATGivenPositions test1', async () => {
8
8
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
9
9
 
10
10
  fep.setArguments(
@@ -17,10 +17,10 @@ test('InsertATGivenPositions test1', () => {
17
17
 
18
18
  let padded: string = ' THIScsurendharompatY IS A NOcoDE plATFNORM';
19
19
 
20
- expect(reve.execute(fep).allResults()[0].getResult().get('result')).toBe(padded);
20
+ expect((await reve.execute(fep)).allResults()[0].getResult().get('result')).toBe(padded);
21
21
  });
22
22
 
23
- test('InsertATGivenPositions test2', () => {
23
+ test('InsertATGivenPositions test2', async () => {
24
24
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
25
25
 
26
26
  fep.setArguments(
@@ -33,10 +33,10 @@ test('InsertATGivenPositions test2', () => {
33
33
 
34
34
  let padded: string = ' THIScsurendharompatY IS A NOcoDE plATFNORM';
35
35
 
36
- expect(reve.execute(fep).allResults()[0].getResult().get('result')).toBe(padded);
36
+ expect((await reve.execute(fep)).allResults()[0].getResult().get('result')).toBe(padded);
37
37
  });
38
38
 
39
- test('InsertATGivenPositions test3', () => {
39
+ test('InsertATGivenPositions test3', async () => {
40
40
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
41
41
 
42
42
  fep.setArguments(
@@ -49,5 +49,5 @@ test('InsertATGivenPositions test3', () => {
49
49
 
50
50
  let padded: string = ' THIScompatY IS A NOcoDE plATsurendharFNORM';
51
51
 
52
- expect(reve.execute(fep).allResults()[0].getResult().get('result')).toBe(padded);
52
+ expect((await reve.execute(fep)).allResults()[0].getResult().get('result')).toBe(padded);
53
53
  });
@@ -4,7 +4,7 @@ import { MapEntry, MapUtil } from '../../../../../src/engine/util/MapUtil';
4
4
 
5
5
  const reve: PostPad = new PostPad();
6
6
 
7
- test('postpad test1', () => {
7
+ test('postpad test1', async () => {
8
8
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
9
9
 
10
10
  fep.setArguments(
@@ -17,10 +17,10 @@ test('postpad test1', () => {
17
17
 
18
18
  let padded: string = ' THIScompatY IS A NOcoDE plATFNORMhiranhiranhi';
19
19
 
20
- expect(reve.execute(fep).allResults()[0].getResult().get('result')).toBe(padded);
20
+ expect((await reve.execute(fep)).allResults()[0].getResult().get('result')).toBe(padded);
21
21
  });
22
22
 
23
- test('postpad test2', () => {
23
+ test('postpad test2', async () => {
24
24
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
25
25
 
26
26
  fep.setArguments(
@@ -33,10 +33,10 @@ test('postpad test2', () => {
33
33
 
34
34
  let reveresed: string = ' THIScompatY IS A NOcoDE plATFNORM h h h h h ';
35
35
 
36
- expect(reve.execute(fep).allResults()[0].getResult().get('result')).toBe(reveresed);
36
+ expect((await reve.execute(fep)).allResults()[0].getResult().get('result')).toBe(reveresed);
37
37
  });
38
38
 
39
- test('postpad test3', () => {
39
+ test('postpad test3', async () => {
40
40
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
41
41
 
42
42
  fep.setArguments(
@@ -50,5 +50,5 @@ test('postpad test3', () => {
50
50
  let reveresed: string =
51
51
  ' THIScompatY IS A NOcoDE plATFNORM surendhar surendhar surendhar surendhar surendhar surendhar surendhar surendhar surendhar ';
52
52
 
53
- expect(reve.execute(fep).allResults()[0].getResult().get('result')).toBe(reveresed);
53
+ expect((await reve.execute(fep)).allResults()[0].getResult().get('result')).toBe(reveresed);
54
54
  });
@@ -4,7 +4,7 @@ import { MapEntry, MapUtil } from '../../../../../src/engine/util/MapUtil';
4
4
 
5
5
  const prepad: PrePad = new PrePad();
6
6
 
7
- test('prepad test1', () => {
7
+ test('prepad test1', async () => {
8
8
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
9
9
 
10
10
  fep.setArguments(
@@ -17,12 +17,12 @@ test('prepad test1', () => {
17
17
 
18
18
  let padded: string = 'hiranhiranhi THIScompatY IS A NOcoDE plATFNORM';
19
19
 
20
- expect(prepad.execute(fep).allResults()[0].getResult().get(PrePad.EVENT_RESULT_NAME)).toBe(
21
- padded,
22
- );
20
+ expect(
21
+ (await prepad.execute(fep)).allResults()[0].getResult().get(PrePad.EVENT_RESULT_NAME),
22
+ ).toBe(padded);
23
23
  });
24
24
 
25
- test('prepad test2', () => {
25
+ test('prepad test2', async () => {
26
26
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
27
27
 
28
28
  fep.setArguments(
@@ -35,10 +35,10 @@ test('prepad test2', () => {
35
35
 
36
36
  let padded: string = ' h h h h THIScompatY IS A NOcoDE plATFNORM';
37
37
 
38
- expect(prepad.execute(fep).allResults()[0].getResult().get('result')).toBe(padded);
38
+ expect((await prepad.execute(fep)).allResults()[0].getResult().get('result')).toBe(padded);
39
39
  });
40
40
 
41
- test('prepad test3', () => {
41
+ test('prepad test3', async () => {
42
42
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
43
43
 
44
44
  fep.setArguments(
@@ -50,5 +50,5 @@ test('prepad test3', () => {
50
50
  );
51
51
 
52
52
  let reveresed: string = 'hira THIScompatY IS A NOcoDE plATFNORM';
53
- expect(prepad.execute(fep).allResults()[0].getResult().get('result')).toBe(reveresed);
53
+ expect((await prepad.execute(fep)).allResults()[0].getResult().get('result')).toBe(reveresed);
54
54
  });
@@ -4,7 +4,7 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
4
4
 
5
5
  const region: RegionMatches = new RegionMatches();
6
6
 
7
- test('toString test1', () => {
7
+ test('toString test1', async () => {
8
8
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
9
9
 
10
10
  fep.setArguments(
@@ -25,11 +25,14 @@ test('toString test1', () => {
25
25
  );
26
26
 
27
27
  expect(
28
- region.execute(fep).allResults()[0].getResult().get(RegionMatches.EVENT_RESULT_NAME),
28
+ (await region.execute(fep))
29
+ .allResults()[0]
30
+ .getResult()
31
+ .get(RegionMatches.EVENT_RESULT_NAME),
29
32
  ).toBe(true);
30
33
  });
31
34
 
32
- test('toString test2', () => {
35
+ test('toString test2', async () => {
33
36
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
34
37
  fep.setArguments(
35
38
  MapUtil.of<string, string | number | boolean>(
@@ -49,11 +52,14 @@ test('toString test2', () => {
49
52
  );
50
53
 
51
54
  expect(
52
- region.execute(fep).allResults()[0].getResult().get(RegionMatches.EVENT_RESULT_NAME),
55
+ (await region.execute(fep))
56
+ .allResults()[0]
57
+ .getResult()
58
+ .get(RegionMatches.EVENT_RESULT_NAME),
53
59
  ).toBe(false);
54
60
  });
55
61
 
56
- test('toString test3', () => {
62
+ test('toString test3', async () => {
57
63
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
58
64
  fep.setArguments(
59
65
  MapUtil.of<string, string | number | boolean>(
@@ -73,6 +79,9 @@ test('toString test3', () => {
73
79
  );
74
80
 
75
81
  expect(
76
- region.execute(fep).allResults()[0].getResult().get(RegionMatches.EVENT_RESULT_NAME),
82
+ (await region.execute(fep))
83
+ .allResults()[0]
84
+ .getResult()
85
+ .get(RegionMatches.EVENT_RESULT_NAME),
77
86
  ).toBe(true);
78
87
  });
@@ -5,32 +5,32 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
5
5
 
6
6
  const reve: Reverse = new Reverse();
7
7
 
8
- test('reverse test1', () => {
8
+ test('reverse test1', async () => {
9
9
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
10
10
 
11
11
  fep.setArguments(MapUtil.of('value', ' mr"ofta"lp edoc on a si sihT'));
12
12
 
13
13
  let reveresed: string = 'This is a no code pl"atfo"rm ';
14
14
 
15
- expect(reve.execute(fep).allResults()[0].getResult().get('value')).toBe(reveresed);
15
+ expect((await reve.execute(fep)).allResults()[0].getResult().get('value')).toBe(reveresed);
16
16
  });
17
17
 
18
- test('reverse test2', () => {
18
+ test('reverse test2', async () => {
19
19
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
20
20
 
21
21
  fep.setArguments(MapUtil.of('value', ' '));
22
22
 
23
23
  let reveresed: string = ' ';
24
24
 
25
- expect(reve.execute(fep).allResults()[0].getResult().get('value')).toBe(reveresed);
25
+ expect((await reve.execute(fep)).allResults()[0].getResult().get('value')).toBe(reveresed);
26
26
  });
27
27
 
28
- // test('reverse test3', () => {
28
+ // test('reverse test3', async () => {
29
29
  // let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
30
30
 
31
31
  // fep.setArguments(MapUtil.of('value', null));
32
32
 
33
33
  // let reveresed: string = ' ';
34
34
 
35
- // expect(reve.execute(fep).allResults()[0].getResult().get('value')).toBe(reveresed);
35
+ // expect((await reve.execute(fep)).allResults()[0].getResult().get('value')).toBe(reveresed);
36
36
  // });
@@ -4,7 +4,7 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
4
4
 
5
5
  const Spli: Split = new Split();
6
6
 
7
- test('split test1', () => {
7
+ test('split test1', async () => {
8
8
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
9
9
  fep.setArguments(
10
10
  MapUtil.of(
@@ -29,10 +29,12 @@ test('split test1', () => {
29
29
  array.push('Driven');
30
30
  array.push('developement');
31
31
 
32
- expect(Spli.execute(fep).allResults()[0].getResult().get('output')).toStrictEqual(array);
32
+ expect((await Spli.execute(fep)).allResults()[0].getResult().get('output')).toStrictEqual(
33
+ array,
34
+ );
33
35
  });
34
36
 
35
- test('split test2', () => {
37
+ test('split test2', async () => {
36
38
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
37
39
  fep.setArguments(
38
40
  MapUtil.of(
@@ -57,5 +59,7 @@ test('split test2', () => {
57
59
  array.push('m');
58
60
  array.push('nt');
59
61
 
60
- expect(Spli.execute(fep).allResults()[0].getResult().get('output')).toStrictEqual(array);
62
+ expect((await Spli.execute(fep)).allResults()[0].getResult().get('output')).toStrictEqual(
63
+ array,
64
+ );
61
65
  });