You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generates a callback for a test framework to execute.
42
+
Runs the KptFunc and asserts the expected output or exception.
43
+
44
+
Example usage:
45
+
46
+
```
47
+
const RUNNER = new TestRunner(myFunc);
48
+
49
+
it('function is a NO OP', async () => {
50
+
await RUNNER.assert());
51
+
};
52
+
```
53
+
54
+
**Parameters:**
55
+
56
+
Name | Type | Default | Description |
57
+
------ | ------ | ------ | ------ |
58
+
`input` | [Configs](_types_.configs.md) | new Configs() | input Configs passed to the function. It is deep-copied before running the function. If undefined, assumes an empty Configs. |
59
+
`expectedOutput?` | [Configs](_types_.configs.md) | - | expected resultant Configs after KptFunc has successfully completed. If undefined, assumes the output should remain unchanged (NO OP). |
60
+
`expectedException?` | undefined | object | - | expected exception to be thrown. If given, expectedOutput is ignored. |
61
+
`expectedExceptionMessage?` | string | RegExp | - | expected message of expection to be thrown. If given, expectedOutput is ignored. |
Similar to [assert](_testing_.testrunner.md#assert) method, but instead returns an assertion function that can be passed directly to 'it'.
72
+
73
+
Example usage:
74
+
75
+
```
76
+
const RUNNER = new TestRunner(myFunc);
77
+
78
+
it('function is a NO OP', RUNNER.assertCallback());
79
+
```
42
80
43
81
**Parameters:**
44
82
45
83
Name | Type | Default | Description |
46
84
------ | ------ | ------ | ------ |
47
-
`input` | [Configs](_types_.configs.md) | new Configs() | is the initial set of Configs to test. By default assumes an empty set of Configs. |
48
-
`expectedOutput?` | [Configs](_types_.configs.md)|[ConfigError](_errors_.configerror.md) | - | is the expected resulting Configs or ConfigError produced by the KptFunc. If undefined, assumes the output should remain unchanged. |
49
-
`expectException?` | undefined | false | true | - | indicates that KptFunc is expected to throw an exception. |
85
+
`input` | [Configs](_types_.configs.md) | new Configs() | input Configs passed to the function. It is deep-copied before running the function. If undefined, assumes an empty Configs. |
86
+
`expectedOutput?` | [Configs](_types_.configs.md) | - | expected resultant Configs after KptFunc has successfully completed. If undefined, assumes the output should remain unchanged (NO OP). |
87
+
`expectedException?` | undefined | object | - | expected exception to be thrown. If given, expectedOutput is ignored. |
88
+
`expectedExceptionMessage?` | string | RegExp | - | expected message of expection to be thrown. If given, expectedOutput is ignored. |
0 commit comments