wildduck
Version:
IMAP server built with Node.js and MongoDB
23 lines (17 loc) • 684 B
JavaScript
/*eslint no-unused-expressions: 0, prefer-arrow-callback: 0 */
;
let imapTools = require('../lib/imap-tools');
let chai = require('chai');
let expect = chai.expect;
chai.config.includeStack = true;
describe('#packMessageRange', function () {
it('should return as is', function () {
expect(imapTools.packMessageRange([1, 3, 5, 9])).to.equal('1,3,5,9');
});
it('should return a range', function () {
expect(imapTools.packMessageRange([1, 2, 3, 4])).to.equal('1:4');
});
it('should return mixed ranges', function () {
expect(imapTools.packMessageRange([1, 3, 4, 6, 8, 9, 10, 11, 13])).to.equal('1,3:4,6,8:11,13');
});
});