mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-29 19:51:17 +08:00
22 lines
684 B
JavaScript
22 lines
684 B
JavaScript
/*eslint no-unused-expressions: 0, prefer-arrow-callback: 0 */
|
|
|
|
'use strict';
|
|
|
|
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');
|
|
});
|
|
});
|