1 | "use strict";
|
2 |
|
3 | const reject = require('./reject');
|
4 | const assert = require('assert');
|
5 |
|
6 | describe(`error`, function ()
|
7 | {
|
8 | let errorCalled = false;
|
9 |
|
10 | function error(a, b, c)
|
11 | {
|
12 | errorCalled = true;
|
13 | assert.equal(a, 'a');
|
14 | assert.equal(b, 'b');
|
15 | assert.equal(c, 'c');
|
16 | }
|
17 | it(`should call error`, function ()
|
18 | {
|
19 | reject({
|
20 | error
|
21 | }, 'b', 'c')('a');
|
22 | assert(errorCalled);
|
23 | })
|
24 |
|
25 | it(`should have detault params`, function ()
|
26 | {
|
27 | reject({
|
28 | error: i => i
|
29 | })('a');
|
30 | })
|
31 |
|
32 | });
|