UNPKG

947 BJavaScriptView Raw
1/*eslint no-magic-numbers: "off"*/
2/*eslint no-invalid-this: "off"*/
3const expect = require('chai').expect;
4const Promise = require('bluebird');
5const Task = require('../../app/models/task');
6const config = require('../../config/index');
7
8const log = config.log;
9
10Promise.longStackTraces();
11Promise.onPossiblyUnhandledRejection((error) => log.error('Likely error: ', error.stack));
12
13
14describe('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