add dateSeparator validation test

This commit is contained in:
2016-08-22 11:24:59 -07:00
parent 83f267a028
commit a5bfb96855

View File

@@ -69,6 +69,12 @@ describe('Esqueue class', function () {
queue = new Esqueue(indexName, { client });
});
it('should throw with invalid dateSeparator setting', function () {
queue = new Esqueue(indexName, { client, dateSeparator: 'a' });
const fn = () => queue.addJob(jobType, payload);
expect(fn).to.throwException();
});
it('should pass queue instance, index name, type and payload', function () {
const job = queue.addJob(jobType, payload);
expect(job.getProp('queue')).to.equal(queue);