@j-o-r/sh 1.1.3 → 1.1.4
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/lib/Test.js +2 -0
- package/package.json +1 -1
- package/types/Test.d.ts +2 -1
package/lib/Test.js
CHANGED
|
@@ -103,6 +103,7 @@ class Test {
|
|
|
103
103
|
* @param {string} description
|
|
104
104
|
* @param {Function|AsyncFunction} callback - sync / async function
|
|
105
105
|
* @throws Error when conditions are not met
|
|
106
|
+
* @returns {Test}
|
|
106
107
|
*/
|
|
107
108
|
add(description, callback) {
|
|
108
109
|
if (jsType(description) !== 'String') {
|
|
@@ -112,6 +113,7 @@ class Test {
|
|
|
112
113
|
throw new Error(`'callback' should be a (async) Function`)
|
|
113
114
|
}
|
|
114
115
|
this.#tests.push({ description, callback });
|
|
116
|
+
return this;
|
|
115
117
|
}
|
|
116
118
|
/**
|
|
117
119
|
* Execute tests
|
package/package.json
CHANGED
package/types/Test.d.ts
CHANGED
|
@@ -50,8 +50,9 @@ declare class Test {
|
|
|
50
50
|
* @param {string} description
|
|
51
51
|
* @param {Function|AsyncFunction} callback - sync / async function
|
|
52
52
|
* @throws Error when conditions are not met
|
|
53
|
+
* @returns {Test}
|
|
53
54
|
*/
|
|
54
|
-
add(description: string, callback: Function | AsyncFunction):
|
|
55
|
+
add(description: string, callback: Function | AsyncFunction): Test;
|
|
55
56
|
/**
|
|
56
57
|
* Execute tests
|
|
57
58
|
* @param {number[]} [execute] - limit the execution tests
|