@@ -102,7 +102,7 @@ let fakes = {
102
102
utils : {
103
103
glob : ( ) => {
104
104
let filenames = [ ] ;
105
- testData . files . forEach ( elem => {
105
+ testData . files . forEach ( ( elem ) => {
106
106
filenames . push ( elem . path ) ;
107
107
} ) ;
108
108
return Promise . resolve ( filenames ) ;
@@ -111,7 +111,7 @@ let fakes = {
111
111
index : {
112
112
getShortIndex : ( ( ) => {
113
113
let idx = { } ;
114
- testData . files . forEach ( elem => {
114
+ testData . files . forEach ( ( elem ) => {
115
115
idx [ utils . parsePagename ( elem . path ) ] = elem . platforms ;
116
116
} ) ;
117
117
return Promise . resolve ( idx ) ;
@@ -130,7 +130,7 @@ let fakes = {
130
130
} ,
131
131
readFile : ( readpath ) => {
132
132
return new Promise ( ( resolve , reject ) => {
133
- let file = testData . files . find ( elem => {
133
+ let file = testData . files . find ( ( elem ) => {
134
134
return elem . path === readpath ;
135
135
} ) ;
136
136
if ( file ) {
@@ -160,7 +160,7 @@ describe('Search', () => {
160
160
stubs . push ( sinon . stub ( utils , 'glob' ) . callsFake ( fakes . utils . glob ) ) ;
161
161
stubs . push ( sinon . stub ( fs , 'readFile' ) . callsFake ( fakes . fs . readFile ) ) ;
162
162
stubs . push ( sinon . stub ( fs , 'writeFile' ) . callsFake ( fakes . fs . writeFile ) ) ;
163
- search . createIndex ( ) . then ( data => {
163
+ search . createIndex ( ) . then ( ( data ) => {
164
164
Object . keys ( data . tfidf ) . length . should . equal ( 20 ) ; // eslint-disable-line
165
165
Object . keys ( data . invertedIndex ) . length . should . equal ( 56 ) ; // eslint-disable-line
166
166
data . invertedIndex [ 'roxi' ] [ 0 ] . should . equal ( '/path/to/file-11.md' ) ;
@@ -181,17 +181,17 @@ describe('Search', () => {
181
181
stubs . push ( sinon . stub ( fs , 'readFile' ) . callsFake ( fakes . fs . readFile ) ) ;
182
182
stubs . push ( sinon . stub ( fs , 'writeFile' ) . callsFake ( fakes . fs . writeFile ) ) ;
183
183
stubs . push ( sinon . stub ( index , 'getShortIndex' ) . callsFake ( fakes . index . getShortIndex ) ) ;
184
- search . getResults ( 'Anthony' ) . then ( data => {
184
+ search . getResults ( 'Anthony' ) . then ( ( data ) => {
185
185
data . length . should . equal ( 4 ) ; // eslint-disable-line
186
186
data [ 0 ] . file . should . equal ( '/path/to/file-09.md' ) ;
187
187
return Promise . resolve ( ) ;
188
188
} ) . then ( ( ) => {
189
- return search . getResults ( 'textnotfound' ) . then ( data => {
189
+ return search . getResults ( 'textnotfound' ) . then ( ( data ) => {
190
190
data . length . should . equal ( 0 ) ;
191
191
return Promise . resolve ( ) ;
192
192
} ) ;
193
193
} ) . then ( ( ) => {
194
- return search . getResults ( 'Joe and Roxie' ) . then ( data => {
194
+ return search . getResults ( 'Joe and Roxie' ) . then ( ( data ) => {
195
195
data . length . should . equal ( 8 ) ; // eslint-disable-line
196
196
data [ 1 ] . file . should . equal ( '/path/to/file-16.md' ) ;
197
197
console . log . restore ( ) ;
0 commit comments