File tree Expand file tree Collapse file tree 2 files changed +0
-50
lines changed Expand file tree Collapse file tree 2 files changed +0
-50
lines changed Original file line number Diff line number Diff line change @@ -39,34 +39,6 @@ describe('smtpclient response parser unit tests', function () {
3939 } )
4040 } )
4141
42- describe ( '#end' , function ( ) {
43- it ( 'should emit error on closed parser' , function ( ) {
44- sinon . stub ( parser , 'onerror' )
45-
46- parser . destroyed = true
47- parser . end ( )
48-
49- expect ( parser . onerror . callCount ) . to . equal ( 1 )
50- expect ( parser . onerror . args [ 0 ] [ 0 ] instanceof Error ) . to . be . true
51-
52- parser . onerror . restore ( )
53- } )
54-
55- it ( 'process the remainder and emit onend' , function ( ) {
56- sinon . stub ( parser , '_processLine' )
57- sinon . stub ( parser , 'onend' )
58-
59- parser . _remainder = 'abc'
60- parser . end ( )
61-
62- expect ( parser . _processLine . withArgs ( 'abc' ) . callCount ) . to . equal ( 1 )
63- expect ( parser . onend . callCount ) . to . equal ( 1 )
64-
65- parser . _processLine . restore ( )
66- parser . onend . restore ( )
67- } )
68- } )
69-
7042 describe ( '#_processLine' , function ( ) {
7143 it ( 'should parse and emit a single line response' , function ( ) {
7244 sinon . stub ( parser , 'ondata' )
Original file line number Diff line number Diff line change @@ -34,28 +34,6 @@ class SmtpResponseParser {
3434 }
3535 }
3636
37- /**
38- * Indicate that all the data from the server has been received. Can be called only once.
39- *
40- * @param {String } [chunk] Chunk of data received from the server
41- */
42- end ( chunk ) {
43- if ( this . destroyed ) {
44- return this . onerror ( new Error ( 'This parser has already been closed, "end" is prohibited' ) )
45- }
46-
47- if ( chunk ) {
48- this . send ( chunk )
49- }
50-
51- if ( this . _remainder ) {
52- this . _processLine ( this . _remainder )
53- }
54-
55- this . destroyed = true
56- this . onend ( )
57- }
58-
5937 // Private API
6038
6139 /**
You can’t perform that action at this time.
0 commit comments