Skip to content

Commit 93fcbe7

Browse files
committed
added documentation
1 parent dbd9e2d commit 93fcbe7

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

dist/falcon/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@ console.log = (input) => {
2121
tempResult.logs === '' ? input + '' : tempResult.logs + '\n' + input;
2222
};
2323

24+
/**
25+
We are overloading this function. It can be used with either 2 or 3 params
26+
* using it with 2 params means the first param is the `title` and the second is the `callback`
27+
* using it with 3 params means the first param is the test `input`, the second is the `title` and the third is the `callback`
28+
*/
2429
// Declares a test unit
2530
const test = (param1, param2, param3) => {
2631
let input;
2732
let title;
2833
let cb;
34+
// This check sets the function up for overloading the params. If the second param is a function, we ignore the third param
35+
// if the second param is not a function, we expect 3 params to be provided.
2936
if (typeof param2 == 'function') {
3037
title = param1;
3138
cb = param2;

falcon/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@ console.log = (input) => {
2121
tempResult.logs === '' ? input + '' : tempResult.logs + '\n' + input;
2222
};
2323

24+
/**
25+
We are overloading this function. It can be used with either 2 or 3 params
26+
* using it with 2 params means the first param is the `title` and the second is the `callback`
27+
* using it with 3 params means the first param is the test `input`, the second is the `title` and the third is the `callback`
28+
*/
2429
// Declares a test unit
2530
const test = (param1, param2, param3) => {
2631
let input;
2732
let title;
2833
let cb;
34+
// This check sets the function up for overloading the params. If the second param is a function, we ignore the third param
35+
// if the second param is not a function, we expect 3 params to be provided.
2936
if (typeof param2 == 'function') {
3037
title = param1;
3138
cb = param2;

0 commit comments

Comments
 (0)