@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.
- package/__tests__/engine/function/system/array/AddFirstTest.ts +13 -12
- package/__tests__/engine/function/system/array/AddTest.ts +11 -11
- package/__tests__/engine/function/system/array/BinarySearchTest.ts +29 -14
- package/__tests__/engine/function/system/array/CompareTest.ts +3 -3
- package/__tests__/engine/function/system/array/CopyTest.ts +5 -5
- package/__tests__/engine/function/system/array/DeleteFirstTest.ts +10 -10
- package/__tests__/engine/function/system/array/DeleteFromTest.ts +8 -8
- package/__tests__/engine/function/system/array/DeleteLastTest.ts +10 -10
- package/__tests__/engine/function/system/array/DeleteTest.ts +60 -25
- package/__tests__/engine/function/system/array/DisjointTest.ts +6 -7
- package/__tests__/engine/function/system/array/Equals.ts +5 -5
- package/__tests__/engine/function/system/array/FillTest.ts +5 -5
- package/__tests__/engine/function/system/array/FrequencyTest.ts +11 -11
- package/__tests__/engine/function/system/array/IndexOfArrayTest.ts +14 -20
- package/__tests__/engine/function/system/array/IndexOfTest.ts +26 -14
- package/__tests__/engine/function/system/array/InsertTest.ts +12 -12
- package/__tests__/engine/function/system/array/LastIndexOfArrayTest.ts +9 -12
- package/__tests__/engine/function/system/array/LastIndexOfTest.ts +16 -16
- package/__tests__/engine/function/system/array/MaxTest.ts +18 -18
- package/__tests__/engine/function/system/array/MinTest.ts +18 -18
- package/__tests__/engine/function/system/array/MisMatchTest.ts +8 -11
- package/__tests__/engine/function/system/array/ReverseTest.ts +12 -12
- package/__tests__/engine/function/system/array/RotateTest.ts +6 -6
- package/__tests__/engine/function/system/array/ShuffleTest.ts +7 -4
- package/__tests__/engine/function/system/array/SortTest.ts +10 -10
- package/__tests__/engine/function/system/array/SubArrayTest.ts +19 -10
- package/__tests__/engine/function/system/context/SetFunctionTest.ts +24 -5
- package/__tests__/engine/function/system/math/AddTest.ts +2 -2
- package/__tests__/engine/function/system/math/RandomIntTest.ts +46 -0
- package/__tests__/engine/function/system/string/ConcatenateTest.ts +4 -4
- package/__tests__/engine/function/system/string/DeleteForGivenLengthTest.ts +8 -4
- package/__tests__/engine/function/system/string/InsertAtGivenPositionTest.ts +6 -6
- package/__tests__/engine/function/system/string/PostPadTest.ts +6 -6
- package/__tests__/engine/function/system/string/PrePadTest.ts +8 -8
- package/__tests__/engine/function/system/string/RegionMatchesTest.ts +15 -6
- package/__tests__/engine/function/system/string/ReverseTest.ts +6 -6
- package/__tests__/engine/function/system/string/SplitTest.ts +8 -4
- package/__tests__/engine/function/system/string/StringFunctionRepoTest2.ts +35 -11
- package/__tests__/engine/function/system/string/StringFunctionRepoTest3.ts +14 -5
- package/__tests__/engine/function/system/string/StringFunctionRepositoryTest.ts +40 -16
- package/__tests__/engine/function/system/string/ToStringTest.ts +6 -6
- package/__tests__/engine/function/system/string/TrimToTest.ts +8 -6
- package/__tests__/engine/runtime/KIRuntimeTest.ts +148 -155
- package/__tests__/engine/runtime/KIRuntimeWithDefinitionTest.ts +89 -0
- package/__tests__/engine/util/LinkedListTest.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +267 -109
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/engine/function/AbstractFunction.ts +5 -3
- package/src/engine/function/Function.ts +1 -1
- package/src/engine/function/system/GenerateEvent.ts +1 -1
- package/src/engine/function/system/If.ts +1 -1
- package/src/engine/function/system/array/AbstractArrayFunction.ts +5 -0
- package/src/engine/function/system/array/Add.ts +1 -1
- package/src/engine/function/system/array/AddFirst.ts +1 -1
- package/src/engine/function/system/array/BinarySearch.ts +1 -1
- package/src/engine/function/system/array/Compare.ts +1 -1
- package/src/engine/function/system/array/Copy.ts +1 -1
- package/src/engine/function/system/array/Delete.ts +24 -32
- package/src/engine/function/system/array/DeleteFirst.ts +1 -1
- package/src/engine/function/system/array/DeleteFrom.ts +1 -1
- package/src/engine/function/system/array/DeleteLast.ts +1 -1
- package/src/engine/function/system/array/Disjoint.ts +1 -1
- package/src/engine/function/system/array/Equals.ts +2 -2
- package/src/engine/function/system/array/Fill.ts +1 -1
- package/src/engine/function/system/array/Frequency.ts +1 -1
- package/src/engine/function/system/array/IndexOf.ts +1 -1
- package/src/engine/function/system/array/IndexOfArray.ts +1 -1
- package/src/engine/function/system/array/Insert.ts +1 -1
- package/src/engine/function/system/array/LastIndexOf.ts +1 -1
- package/src/engine/function/system/array/LastIndexOfArray.ts +1 -1
- package/src/engine/function/system/array/Max.ts +1 -1
- package/src/engine/function/system/array/Min.ts +1 -1
- package/src/engine/function/system/array/MisMatch.ts +1 -1
- package/src/engine/function/system/array/Reverse.ts +1 -1
- package/src/engine/function/system/array/Rotate.ts +1 -1
- package/src/engine/function/system/array/Shuffle.ts +1 -1
- package/src/engine/function/system/array/Sort.ts +1 -1
- package/src/engine/function/system/array/SubArray.ts +1 -1
- package/src/engine/function/system/context/Create.ts +1 -1
- package/src/engine/function/system/context/Get.ts +1 -1
- package/src/engine/function/system/context/SetFunction.ts +1 -1
- package/src/engine/function/system/loop/CountLoop.ts +1 -1
- package/src/engine/function/system/loop/RangeLoop.ts +1 -1
- package/src/engine/function/system/math/Add.ts +2 -4
- package/src/engine/function/system/math/GenericMathFunction.ts +2 -4
- package/src/engine/function/system/math/Hypotenuse.ts +2 -6
- package/src/engine/function/system/math/Maximum.ts +2 -4
- package/src/engine/function/system/math/Minimum.ts +2 -4
- package/src/engine/function/system/math/Random.ts +1 -1
- package/src/engine/function/system/math/RandomFloat.ts +56 -0
- package/src/engine/function/system/math/RandomInt.ts +56 -0
- package/src/engine/function/system/string/AbstractStringFunction.ts +24 -8
- package/src/engine/function/system/string/Concatenate.ts +2 -2
- package/src/engine/function/system/string/DeleteForGivenLength.ts +25 -15
- package/src/engine/function/system/string/InsertAtGivenPosition.ts +17 -7
- package/src/engine/function/system/string/PostPad.ts +20 -10
- package/src/engine/function/system/string/PrePad.ts +17 -7
- package/src/engine/function/system/string/RegionMatches.ts +40 -22
- package/src/engine/function/system/string/ReplaceAtGivenPosition.ts +26 -13
- package/src/engine/function/system/string/Reverse.ts +4 -3
- package/src/engine/function/system/string/Split.ts +13 -4
- package/src/engine/function/system/string/ToString.ts +9 -5
- package/src/engine/function/system/string/TrimTo.ts +13 -6
- package/src/engine/json/schema/Schema.ts +1 -0
- package/src/engine/model/Event.ts +15 -0
- package/src/engine/model/FunctionDefinition.ts +76 -29
- package/src/engine/model/Parameter.ts +11 -0
- package/src/engine/model/ParameterReference.ts +8 -1
- package/src/engine/model/Position.ts +5 -0
- package/src/engine/model/Statement.ts +16 -0
- package/src/engine/model/StatementGroup.ts +7 -0
- package/src/engine/runtime/KIRuntime.ts +26 -24
- 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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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(
|
|
15
|
-
|
|
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(
|
|
27
|
+
expect(
|
|
28
|
+
(await trim.execute(fep)).allResults()[0].getResult().get(TrimTo.EVENT_RESULT_NAME),
|
|
29
|
+
).toBe('');
|
|
28
30
|
});
|