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
{{ message }}
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# funpara
2
2
3
-
Function parameter library to ease development and testing. The library provides Date and Fetch related functions that can be used without complicated spy/mock setups so that an application can easily be tested with function parameters.
3
+
Function parameter library to ease development and testing. The library provides Date, Exit and Fetch related functions that can be used without complicated spy/mock setups so that an application can easily be tested with function parameters.
4
4
5
5
## Installation
6
6
@@ -61,6 +61,7 @@ In **tests/index.test.ts** there are additional examples how the available code
61
61
### Types
62
62
63
63
-**DateFunction**: Type for a function that returns a Date.
64
+
-**ExitFunction**: Type for a function that given an exit code does not return anything.
64
65
-**FetchFunction**: Type for a fetch function that given an input (url, request, etc.) and request init returns a Promise<Response>
65
66
66
67
### Core functions
@@ -69,6 +70,7 @@ The following core functions can be used to create a new function or create dyna
69
70
70
71
-**nowDateFunction**: Returns a DateFunction that returns the current date.
71
72
-**fixedDateFunction**: Returns a DateFunction that returns a fixed date that matches the given date string.
73
+
-**doNotExitFunction**: Exit function that does not exit the process but throws an error instead.
72
74
-**fixedResponseFetchFunction**: Returns a FetchFunction that always returns a fixed response that matches the given body init and response init values.
0 commit comments