@fincity/kirun-js 1.0.5 → 1.1.0

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 (105) 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 +10 -10
  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/string/ConcatenateTest.ts +4 -4
  30. package/__tests__/engine/function/system/string/DeleteForGivenLengthTest.ts +8 -4
  31. package/__tests__/engine/function/system/string/InsertAtGivenPositionTest.ts +6 -6
  32. package/__tests__/engine/function/system/string/PostPadTest.ts +6 -6
  33. package/__tests__/engine/function/system/string/PrePadTest.ts +8 -8
  34. package/__tests__/engine/function/system/string/RegionMatchesTest.ts +15 -6
  35. package/__tests__/engine/function/system/string/ReverseTest.ts +6 -6
  36. package/__tests__/engine/function/system/string/SplitTest.ts +8 -4
  37. package/__tests__/engine/function/system/string/StringFunctionRepoTest2.ts +35 -11
  38. package/__tests__/engine/function/system/string/StringFunctionRepoTest3.ts +14 -5
  39. package/__tests__/engine/function/system/string/StringFunctionRepositoryTest.ts +40 -16
  40. package/__tests__/engine/function/system/string/ToStringTest.ts +6 -6
  41. package/__tests__/engine/function/system/string/TrimToTest.ts +8 -6
  42. package/__tests__/engine/runtime/KIRuntimeTest.ts +148 -155
  43. package/__tests__/engine/util/LinkedListTest.ts +9 -0
  44. package/dist/index.js +1 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/module.js +1 -1
  47. package/dist/module.js.map +1 -1
  48. package/dist/types.d.ts +258 -109
  49. package/dist/types.d.ts.map +1 -1
  50. package/package.json +1 -1
  51. package/src/engine/function/AbstractFunction.ts +5 -3
  52. package/src/engine/function/Function.ts +1 -1
  53. package/src/engine/function/system/GenerateEvent.ts +1 -1
  54. package/src/engine/function/system/If.ts +1 -1
  55. package/src/engine/function/system/array/Add.ts +1 -1
  56. package/src/engine/function/system/array/AddFirst.ts +1 -1
  57. package/src/engine/function/system/array/BinarySearch.ts +1 -1
  58. package/src/engine/function/system/array/Compare.ts +1 -1
  59. package/src/engine/function/system/array/Copy.ts +1 -1
  60. package/src/engine/function/system/array/Delete.ts +1 -1
  61. package/src/engine/function/system/array/DeleteFirst.ts +1 -1
  62. package/src/engine/function/system/array/DeleteFrom.ts +1 -1
  63. package/src/engine/function/system/array/DeleteLast.ts +1 -1
  64. package/src/engine/function/system/array/Disjoint.ts +1 -1
  65. package/src/engine/function/system/array/Equals.ts +2 -2
  66. package/src/engine/function/system/array/Fill.ts +1 -1
  67. package/src/engine/function/system/array/Frequency.ts +1 -1
  68. package/src/engine/function/system/array/IndexOf.ts +1 -1
  69. package/src/engine/function/system/array/IndexOfArray.ts +1 -1
  70. package/src/engine/function/system/array/Insert.ts +1 -1
  71. package/src/engine/function/system/array/LastIndexOf.ts +1 -1
  72. package/src/engine/function/system/array/LastIndexOfArray.ts +1 -1
  73. package/src/engine/function/system/array/Max.ts +1 -1
  74. package/src/engine/function/system/array/Min.ts +1 -1
  75. package/src/engine/function/system/array/MisMatch.ts +1 -1
  76. package/src/engine/function/system/array/Reverse.ts +1 -1
  77. package/src/engine/function/system/array/Rotate.ts +1 -1
  78. package/src/engine/function/system/array/Shuffle.ts +1 -1
  79. package/src/engine/function/system/array/Sort.ts +1 -1
  80. package/src/engine/function/system/array/SubArray.ts +1 -1
  81. package/src/engine/function/system/context/Create.ts +1 -1
  82. package/src/engine/function/system/context/Get.ts +1 -1
  83. package/src/engine/function/system/context/SetFunction.ts +1 -1
  84. package/src/engine/function/system/loop/CountLoop.ts +1 -1
  85. package/src/engine/function/system/loop/RangeLoop.ts +1 -1
  86. package/src/engine/function/system/math/Add.ts +2 -4
  87. package/src/engine/function/system/math/GenericMathFunction.ts +2 -4
  88. package/src/engine/function/system/math/Hypotenuse.ts +2 -6
  89. package/src/engine/function/system/math/Maximum.ts +2 -4
  90. package/src/engine/function/system/math/Minimum.ts +2 -4
  91. package/src/engine/function/system/math/Random.ts +1 -1
  92. package/src/engine/function/system/string/AbstractStringFunction.ts +24 -8
  93. package/src/engine/function/system/string/Concatenate.ts +2 -2
  94. package/src/engine/function/system/string/DeleteForGivenLength.ts +25 -15
  95. package/src/engine/function/system/string/InsertAtGivenPosition.ts +17 -7
  96. package/src/engine/function/system/string/PostPad.ts +20 -10
  97. package/src/engine/function/system/string/PrePad.ts +17 -7
  98. package/src/engine/function/system/string/RegionMatches.ts +40 -22
  99. package/src/engine/function/system/string/ReplaceAtGivenPosition.ts +26 -13
  100. package/src/engine/function/system/string/Reverse.ts +4 -3
  101. package/src/engine/function/system/string/Split.ts +13 -4
  102. package/src/engine/function/system/string/ToString.ts +9 -5
  103. package/src/engine/function/system/string/TrimTo.ts +13 -6
  104. package/src/engine/runtime/KIRuntime.ts +26 -24
  105. package/src/index.ts +100 -21
@@ -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
  });
@@ -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
  });