@@ -5,7 +5,7 @@ import path from 'path'
5
5
import generateTasks from '../lib/generateTasks'
6
6
import resolveGitRepo from '../lib/resolveGitRepo'
7
7
8
- const normalizePath = path => normalize ( path )
8
+ const normalizePath = ( path ) => normalize ( path )
9
9
10
10
const files = [
11
11
'test.js' ,
@@ -52,15 +52,15 @@ describe('generateTasks', () => {
52
52
gitDir,
53
53
files
54
54
} )
55
- task . fileList . forEach ( file => {
55
+ task . fileList . forEach ( ( file ) => {
56
56
expect ( path . isAbsolute ( file ) ) . toBe ( true )
57
57
} )
58
58
} )
59
59
60
60
it ( 'should not match non-children files' , async ( ) => {
61
61
const relPath = path . join ( process . cwd ( ) , '..' )
62
62
const result = await generateTasks ( { config, cwd, gitDir : relPath , files } )
63
- const linter = result . find ( item => item . pattern === '*.js' )
63
+ const linter = result . find ( ( item ) => item . pattern === '*.js' )
64
64
expect ( linter ) . toEqual ( {
65
65
pattern : '*.js' ,
66
66
commands : 'root-js' ,
@@ -71,7 +71,7 @@ describe('generateTasks', () => {
71
71
it ( 'should return an empty file list for linters with no matches.' , async ( ) => {
72
72
const result = await generateTasks ( { config, cwd, gitDir, files } )
73
73
74
- result . forEach ( task => {
74
+ result . forEach ( ( task ) => {
75
75
if ( task . commands === 'unknown-js' || task . commands === 'parent-dir-css-or-js' ) {
76
76
expect ( task . fileList . length ) . toEqual ( 0 )
77
77
} else {
@@ -82,7 +82,7 @@ describe('generateTasks', () => {
82
82
83
83
it ( 'should match pattern "*.js"' , async ( ) => {
84
84
const result = await generateTasks ( { config, cwd, gitDir, files } )
85
- const linter = result . find ( item => item . pattern === '*.js' )
85
+ const linter = result . find ( ( item ) => item . pattern === '*.js' )
86
86
expect ( linter ) . toEqual ( {
87
87
pattern : '*.js' ,
88
88
commands : 'root-js' ,
@@ -98,7 +98,7 @@ describe('generateTasks', () => {
98
98
99
99
it ( 'should match pattern "**/*.js"' , async ( ) => {
100
100
const result = await generateTasks ( { config, cwd, gitDir, files } )
101
- const linter = result . find ( item => item . pattern === '**/*.js' )
101
+ const linter = result . find ( ( item ) => item . pattern === '**/*.js' )
102
102
expect ( linter ) . toEqual ( {
103
103
pattern : '**/*.js' ,
104
104
commands : 'any-js' ,
@@ -114,7 +114,7 @@ describe('generateTasks', () => {
114
114
115
115
it ( 'should match pattern "deeper/*.js"' , async ( ) => {
116
116
const result = await generateTasks ( { config, cwd, gitDir, files } )
117
- const linter = result . find ( item => item . pattern === 'deeper/*.js' )
117
+ const linter = result . find ( ( item ) => item . pattern === 'deeper/*.js' )
118
118
expect ( linter ) . toEqual ( {
119
119
pattern : 'deeper/*.js' ,
120
120
commands : 'deeper-js' ,
@@ -124,7 +124,7 @@ describe('generateTasks', () => {
124
124
125
125
it ( 'should match pattern ".hidden/*.js"' , async ( ) => {
126
126
const result = await generateTasks ( { config, cwd, gitDir, files } )
127
- const linter = result . find ( item => item . pattern === '.hidden/*.js' )
127
+ const linter = result . find ( ( item ) => item . pattern === '.hidden/*.js' )
128
128
expect ( linter ) . toEqual ( {
129
129
pattern : '.hidden/*.js' ,
130
130
commands : 'hidden-js' ,
@@ -134,7 +134,7 @@ describe('generateTasks', () => {
134
134
135
135
it ( 'should match pattern "*.{css,js}"' , async ( ) => {
136
136
const result = await generateTasks ( { config, cwd, gitDir, files } )
137
- const linter = result . find ( item => item . pattern === '*.{css,js}' )
137
+ const linter = result . find ( ( item ) => item . pattern === '*.{css,js}' )
138
138
expect ( linter ) . toEqual ( {
139
139
pattern : '*.{css,js}' ,
140
140
commands : 'root-css-or-js' ,
@@ -160,7 +160,7 @@ describe('generateTasks', () => {
160
160
gitDir,
161
161
files
162
162
} )
163
- const linter = result . find ( item => item . pattern === '*.js' )
163
+ const linter = result . find ( ( item ) => item . pattern === '*.js' )
164
164
expect ( linter ) . toEqual ( {
165
165
pattern : '*.js' ,
166
166
commands : 'root-js' ,
@@ -175,7 +175,7 @@ describe('generateTasks', () => {
175
175
gitDir,
176
176
files
177
177
} )
178
- const linter = result . find ( item => item . pattern === '../*.{css,js}' )
178
+ const linter = result . find ( ( item ) => item . pattern === '../*.{css,js}' )
179
179
expect ( linter ) . toEqual ( {
180
180
commands : 'parent-dir-css-or-js' ,
181
181
fileList : [ `${ gitDir } /test.js` , `${ gitDir } /test.css` ] . map ( normalizePath ) ,
@@ -185,7 +185,7 @@ describe('generateTasks', () => {
185
185
186
186
it ( 'should be able to return relative paths for "*.{css,js}"' , async ( ) => {
187
187
const result = await generateTasks ( { config, cwd, gitDir, files, relative : true } )
188
- const linter = result . find ( item => item . pattern === '*.{css,js}' )
188
+ const linter = result . find ( ( item ) => item . pattern === '*.{css,js}' )
189
189
expect ( linter ) . toEqual ( {
190
190
pattern : '*.{css,js}' ,
191
191
commands : 'root-css-or-js' ,
0 commit comments