@fincity/kirun-js 1.6.14 → 1.6.15

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.
@@ -26,6 +26,14 @@ class Print extends AbstractFunction {
26
26
  new Map([
27
27
  Parameter.ofEntry(Print.VALUES, Schema.ofAny(Print.VALUES), true),
28
28
  Parameter.ofEntry(Print.VALUE, Schema.ofAny(Print.VALUE)),
29
+ Parameter.ofEntry(
30
+ Print.VALUE + 'Pick1',
31
+ Schema.ofBoolean(Print.VALUE + 'Pick1').setDefaultValue(false),
32
+ ),
33
+ Parameter.ofEntry(
34
+ Print.VALUE + 'Pick2',
35
+ Schema.ofString(Print.VALUE + 'Pick2').setDefaultValue(''),
36
+ ),
29
37
  ]),
30
38
  );
31
39
 
@@ -36,14 +44,20 @@ class Print extends AbstractFunction {
36
44
  protected async internalExecute(context: FunctionExecutionParameters): Promise<FunctionOutput> {
37
45
  let values = context.getArguments()?.get(Print.VALUES);
38
46
  let value = context.getArguments()?.get(Print.VALUE);
47
+ let valuePick1 = context.getArguments()?.get(Print.VALUE + 'Pick1');
48
+ let valuePick2 = context.getArguments()?.get(Print.VALUE + 'Pick2');
39
49
 
40
50
  console?.log('Values', ...values);
41
51
  console?.log('Value', value);
52
+ console?.log('ValuePick1', valuePick1);
53
+ console?.log('ValuePick2', valuePick2);
42
54
 
43
55
  return new FunctionOutput([EventResult.outputOf(new Map())]);
44
56
  }
45
57
  }
46
58
 
59
+ const mock = jest.spyOn(global.console, 'log').mockImplementation();
60
+
47
61
  test('KIRuntime With Definition no values passed ', async () => {
48
62
  var def = {
49
63
  name: 'Make an error',
@@ -80,7 +94,7 @@ test('KIRuntime With Definition no values passed ', async () => {
80
94
  new KIRunSchemaRepository(),
81
95
  ).setArguments(new Map()),
82
96
  );
83
- console.log(fo);
97
+ expect(mock).toBeCalledTimes(4);
84
98
  } catch (e: any) {
85
99
  console.error(e);
86
100
  }
@@ -122,7 +136,7 @@ test('KIRuntime With Definition with no value passed', async () => {
122
136
  new KIRunSchemaRepository(),
123
137
  ).setArguments(new Map()),
124
138
  );
125
- console.log(fo);
139
+ expect(mock).toBeCalledTimes(8);
126
140
  } catch (e: any) {
127
141
  console.error(e);
128
142
  }
@@ -165,7 +179,7 @@ test('KIRuntime With Definition with no value and values passed', async () => {
165
179
  new KIRunSchemaRepository(),
166
180
  ).setArguments(new Map()),
167
181
  );
168
- console.log(fo);
182
+ expect(mock).toBeCalledTimes(12);
169
183
  } catch (e: any) {
170
184
  console.error(e);
171
185
  }