Skip to content

Commit dccf719

Browse files
committed
🥭 w/ test
1 parent a395da9 commit dccf719

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const funcxion = require('./');
2+
const assert = require('assert');
3+
4+
5+
// 1. Basic tests.
6+
function example1() {
7+
var a = funcxion.composeRight(x => x*x, x => x+2);
8+
assert.equal(a(10), 102);
9+
// → 102
10+
11+
var a = funcxion.curry((x, y) => x+y);
12+
assert.equal(a(2)(3), 5);
13+
// → 7
14+
15+
var a = funcxion.unspread(Math.max);
16+
assert.equal(a([2, 3, 1]), 3);
17+
// → 1.25
18+
19+
var a = funcxion.parameters((x, y) => x+y);
20+
assert.deepEqual(a, ['x', 'y']);
21+
// → [ 'x', 'y' ]
22+
}
23+
example1();

0 commit comments

Comments
 (0)