1 |
|
2 |
|
3 | const expect = require('chai').expect;
|
4 | const Promise = require('bluebird');
|
5 | const Task = require('../../app/models/task');
|
6 | const config = require('../../config/index');
|
7 |
|
8 | const log = config.log;
|
9 |
|
10 | Promise.longStackTraces();
|
11 | Promise.onPossiblyUnhandledRejection((error) => log.error('Likely error: ', error.stack));
|
12 |
|
13 |
|
14 | describe('task model', () => {
|
15 | it('should reject task with malformed mutator', () => {
|
16 | const taskParams = {
|
17 | source: {
|
18 | host: 'something',
|
19 | port: 9200
|
20 | },
|
21 | destination: {
|
22 | host: 'something',
|
23 | port: 9200
|
24 | },
|
25 | transfer: {
|
26 | documents: {
|
27 | fromIndices: '*'
|
28 | }
|
29 | },
|
30 | mutators: {
|
31 | actions: {
|
32 | namespace: 'someNamespace',
|
33 | id: 'someId'
|
34 | }
|
35 | }
|
36 | };
|
37 |
|
38 | expect(() => new Task(taskParams)).to.throw(/actions/);
|
39 | });
|
40 | }); |
\ | No newline at end of file |