@@ -4,9 +4,7 @@ import * as io from '../src/utils/io.js'
44import  t9 ,  { convert ,  convertLine ,  convertMulti }  from  '../src/spelling/t9.js' 
55
66describe ( 't9-spelling' ,  ( )  =>  { 
7- 
87  describe ( 'single line' ,  ( )  =>  { 
9- 
108    it ( 'spell "hi"' ,  ( )  =>  { 
119      expect ( convertLine ( 'hi' ) ) . to . eq ( '44 444' ) 
1210    } ) 
@@ -30,8 +28,7 @@ describe('t9-spelling', () => {
3028  } ) 
3129
3230  describe ( 'convert multiline' ,  ( )  =>  { 
33- 
34-     before ( function ( )  { 
31+     before ( function  ( )  { 
3532      const  input  =  `4 
3633hi 
3734yes 
@@ -41,54 +38,50 @@ hello world`
4138      this . result  =  convertMulti ( input ) 
4239    } ) 
4340
44-     it ( 'skip first and empty line' ,  function ( )  { 
41+     it ( 'skip first and empty line' ,  function   ( )  { 
4542      expect ( this . result ) . to . have . length ( 4 ) 
4643    } ) 
4744
48-     it ( 'convert each line' ,  function ( )  { 
45+     it ( 'convert each line' ,  function   ( )  { 
4946      expect ( this . result [ 0 ] ) . to . eq ( '44 444' ) 
5047    } ) 
5148
52-     it ( 'convert last line' ,  function ( )  { 
49+     it ( 'convert last line' ,  function   ( )  { 
5350      expect ( this . result [ 3 ] ) . to . eq ( '4433555 555666096667775553' ) 
5451    } ) 
5552  } ) 
5653
5754  describe ( 'convert' ,  ( )  =>  { 
58- 
59-     before ( function ( )  { 
55+     before ( function  ( )  { 
6056      this . result  =  convert ( `2\n hi\nyes` ) 
6157    } ) 
6258
63-     it ( 'returns single string' ,  function ( )  { 
59+     it ( 'returns single string' ,  function   ( )  { 
6460      expect ( this . result ) . to . be . a ( 'String' ) 
6561    } ) 
6662
67-     it ( 'format each line' ,  function ( )  { 
63+     it ( 'format each line' ,  function   ( )  { 
6864      expect ( this . result ) . to . eq ( 'Case #1: 044 444\nCase #2: 999337777' ) 
6965    } ) 
70- 
7166  } ) 
7267
7368  describe ( 'default' ,  ( )  =>  { 
74- 
75-     before ( function ( )  { 
69+     before ( function  ( )  { 
7670      this . writeFile  =  td . replace ( io ,  'writeFile' ) 
7771      const  readAsString  =  td . replace ( io ,  'readAsString' ) 
7872      const  input  =  `2\nfoo  bar\nboo` 
7973      td . when ( readAsString ( 'input.file' ) ) . thenReturn ( Promise . resolve ( input ) ) 
8074    } ) 
8175
82-     afterEach ( function ( )  { 
76+     afterEach ( function   ( )  { 
8377      td . reset ( ) 
8478    } ) 
8579
86-     it ( 'calls readAsString' ,  function ( ) { 
80+     it ( 'calls readAsString' ,  function   ( )   { 
8781      return  t9 ( 'input.file' ) . then ( ( )  =>  { 
8882        // console.log(td.explain(this.writeFile).description) 
8983        td . verify ( this . writeFile ( 'Case #1: 333666 6660 022 2777\nCase #2: 22666 666' ) ) 
9084      } ) 
9185    } ) 
92- 
9386  } ) 
9487} ) 
0 commit comments