1+ /* global define, it, describe, context */ 
2+ 
13var  expect  =  require ( 'chai' ) . expect ; 
2- var  stream  =  require ( 'stream' ) ; 
3- var  util  =  require ( 'util' ) ; 
44var  FixMe  =  require ( '../lib/fix-me.js' ) ; 
5+ var  IssueBuffer  =  require ( './support/issue_buffer' ) ; 
56
67describe ( "fixMe" ,  function ( ) { 
78  describe ( "#run(engineConfig)" ,  function ( )  { 
@@ -12,7 +13,7 @@ describe("fixMe", function(){
1213        engine . find  =  function ( _ ,  strings )  { 
1314          expect ( strings ) . to . have . members ( [ 'BUG' ,  'FIXME' ,  'HACK' ,  'TODO' ,  'XXX' ] ) ; 
1415          done ( ) ; 
15-         } 
16+         } ; 
1617
1718        engine . run ( ) ; 
1819      } ) ; 
@@ -23,7 +24,7 @@ describe("fixMe", function(){
2324        engine . find  =  function ( paths )  { 
2425          expect ( paths ) . to . have . members ( [ './' ] ) ; 
2526          done ( ) ; 
26-         } 
27+         } ; 
2728
2829        engine . run ( ) ; 
2930      } ) ; 
@@ -36,9 +37,9 @@ describe("fixMe", function(){
3637      } ; 
3738
3839      engine . find  =  function ( paths )  { 
39-         expect ( paths ) . to . have . members ( [ 'test/fixtures/code/src/code/test.js' ] ) 
40+         expect ( paths ) . to . have . members ( [ 'test/fixtures/code/src/code/test.js' ] ) ; 
4041        done ( ) ; 
41-       } 
42+       } ; 
4243
4344      engine . run ( config ) ; 
4445    } ) ; 
@@ -54,7 +55,7 @@ describe("fixMe", function(){
5455      engine . find  =  function ( _ ,  strings )  { 
5556        expect ( strings ) . to . have . members ( [ 'SUP' ] ) ; 
5657        done ( ) ; 
57-       } 
58+       } ; 
5859
5960      engine . run ( engineConfig ) ; 
6061    } ) ; 
@@ -68,7 +69,7 @@ describe("fixMe", function(){
6869      engine . find ( [ 'test/fixtures/file.js' ] ,  [ 'TODO' ,  'SUP' ] ,  function ( )  { 
6970        var  issues  =  buf . toIssues ( ) ; 
7071
71-         expect ( issues . length ) . to . eq ( 2 ) 
72+         expect ( issues . length ) . to . eq ( 2 ) ; 
7273
7374        expect ( issues [ 0 ] . categories ) . to . have . members ( [ 'Bug Risk' ] ) ; 
7475        expect ( issues [ 0 ] . check_name ) . to . eq ( 'TODO' ) ; 
@@ -142,20 +143,3 @@ describe("fixMe", function(){
142143    } ) ; 
143144  } ) ; 
144145} ) ; 
145- 
146- function  IssueBuffer ( )  { 
147-   this . _data  =  "" ; 
148-   stream . Writable . call ( this ) ; 
149- } 
150- 
151- util . inherits ( IssueBuffer ,  stream . Writable ) ; 
152- 
153- IssueBuffer . prototype . _write  =  function ( chunk ,  encoding ,  done )  { 
154-   this . _data  +=  chunk . toString ( ) ; 
155-   done ( ) ; 
156- } ; 
157- 
158- IssueBuffer . prototype . toIssues  =  function ( )  { 
159-   if  ( this . _data . length  ===  0 )  return  [ ] ; 
160-   return  this . _data . slice ( 0 ,  - 1 ) . split ( '\0' ) . map ( ( json )  =>  JSON . parse ( json ) ) ; 
161- } 
0 commit comments