UNPKG
tamda
Version:
latest (1.0.5)
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
Practical functional programming library for TypeScript
github.com/rabelloo/tamda
rabelloo/tamda
tamda
/
src
/
logic
/
opposite.spec.ts
12 lines
(8 loc)
•
282 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
{ opposite }
from
'./opposite'
;
describe
(
'opposite'
,
() =>
{
it
(
`should create a function that returns the opposite of the supplied function's return (i.e. * -1)`
,
() =>
{
const
fn
= (
) =>
1
;
const
negate =
opposite
(fn);
expect
(
negate
()).
toBe
(-
1
); }); });