Skip to content

Commit 3bf782a

Browse files
author
Guðmundur Gunnarsson
committed
Added a test to make sure the queued command has the valueAsString option.
1 parent ec844b6 commit 3bf782a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/unit/emailjs-imap-client-imap-test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,27 @@
516516
client._clientQueue[0].callback({});
517517
}, 0);
518518
});
519+
520+
it('should store valueAsString option in the command', (done) => {
521+
sinon.stub(client, '_sendRequest');
522+
523+
client._tagCounter = 100;
524+
client._clientQueue = [];
525+
client._canSend = false;
526+
527+
client.enqueueCommand({
528+
command: 'abc',
529+
valueAsString: false
530+
}, ['def'], {
531+
t: 1
532+
}).then(() => {
533+
expect(client._clientQueue[0].request.valueAsString).to.equal(false);
534+
}).then(done).catch(done);
535+
536+
setTimeout(() => {
537+
client._clientQueue[0].callback({});
538+
}, 0);
539+
});
519540
});
520541

521542
describe('#_sendRequest', () => {

0 commit comments

Comments
 (0)