File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,30 @@ describe('trust-on-first-use', function() {
167167 driver . session ( ) ;
168168
169169 setTimeout ( function ( ) {
170- expect ( fs . readFileSync ( knownHostsPath , 'utf8' ) . trim ( ) . split ( '\n' ) . length ) . toBe ( 1 ) ;
170+ var lines = { } ;
171+ fs . readFileSync ( knownHostsPath , 'utf8' )
172+ . split ( '\n' )
173+ . filter ( function ( line ) {
174+ return ! ! ( line . trim ( ) ) ;
175+ } )
176+ . forEach ( function ( line ) {
177+ if ( ! lines [ line ] ) {
178+ lines [ line ] = 0 ;
179+ }
180+ lines [ line ] ++ ;
181+ } ) ;
182+
183+ var duplicatedLines = Object
184+ . keys ( lines )
185+ . map ( function ( line ) {
186+ return lines [ line ] ;
187+ } )
188+ . filter ( function ( count ) {
189+ return count > 1 ;
190+ } )
191+ . length ;
192+
193+ expect ( duplicatedLines ) . toBe ( 0 ) ;
171194 done ( ) ;
172195 } , 1000 ) ;
173196 } ) ;
You can’t perform that action at this time.
0 commit comments