@@ -13,8 +13,9 @@ describe('cosmicConfigTransformer Unit Tests', () => {
1313 test ( 'null should be returned' , ( ) => {
1414 const cwd = 'cwd' ;
1515 const configBaseDirectory = 'configBaseDirectory' ;
16+ const filePathBeingLinted = 'myLintedFilePath' ;
1617
17- const transformer = cosmicConfigTransformer . transform ( cwd , configBaseDirectory ) ;
18+ const transformer = cosmicConfigTransformer . transform ( cwd , configBaseDirectory , filePathBeingLinted ) ;
1819 const actual = transformer ( null ) ;
1920 expect ( actual ) . toBeNull ( ) ;
2021 } ) ;
@@ -31,8 +32,9 @@ describe('cosmicConfigTransformer Unit Tests', () => {
3132
3233 const cwd = 'cwd' ;
3334 const configBaseDirectory = 'configBaseDirectory' ;
35+ const filePathBeingLinted = 'myLintedFilePath' ;
3436
35- const transformer = cosmicConfigTransformer . transform ( cwd , configBaseDirectory ) ;
37+ const transformer = cosmicConfigTransformer . transform ( cwd , configBaseDirectory , filePathBeingLinted ) ;
3638 const cosmiconfigResult = {
3739 config : {
3840 property : 'value'
@@ -44,9 +46,9 @@ describe('cosmicConfigTransformer Unit Tests', () => {
4446
4547 expect ( path . dirname ) . toHaveBeenCalledTimes ( 0 ) ;
4648 expect ( applyExtendsIfSpecified ) . toHaveBeenCalledTimes ( 1 ) ;
47- expect ( applyExtendsIfSpecified ) . toHaveBeenCalledWith ( cosmiconfigResult . config , cosmiconfigResult . filepath ) ;
49+ expect ( applyExtendsIfSpecified ) . toHaveBeenCalledWith ( cosmiconfigResult . config , filePathBeingLinted ) ;
4850 expect ( applyOverrides ) . toHaveBeenCalledTimes ( 1 ) ;
49- expect ( applyOverrides ) . toHaveBeenCalledWith ( cwd , cosmiconfigResult . filepath , 'rules' , 'overrides' ) ;
51+ expect ( applyOverrides ) . toHaveBeenCalledWith ( cwd , filePathBeingLinted , 'rules' , 'overrides' ) ;
5052 } ) ;
5153 } ) ;
5254
@@ -61,8 +63,9 @@ describe('cosmicConfigTransformer Unit Tests', () => {
6163
6264 const cwd = 'cwd' ;
6365 const configBaseDirectory = null ;
66+ const filePathBeingLinted = 'myLintedFilePath' ;
6467
65- const transformer = cosmicConfigTransformer . transform ( cwd , configBaseDirectory ) ;
68+ const transformer = cosmicConfigTransformer . transform ( cwd , configBaseDirectory , filePathBeingLinted ) ;
6669 const cosmiconfigResult = {
6770 config : {
6871 property : 'value'
@@ -75,9 +78,9 @@ describe('cosmicConfigTransformer Unit Tests', () => {
7578 expect ( path . dirname ) . toHaveBeenCalledTimes ( 1 ) ;
7679 expect ( path . dirname ) . toHaveBeenCalledWith ( cosmiconfigResult . filepath ) ;
7780 expect ( applyExtendsIfSpecified ) . toHaveBeenCalledTimes ( 1 ) ;
78- expect ( applyExtendsIfSpecified ) . toHaveBeenCalledWith ( cosmiconfigResult . config , cosmiconfigResult . filepath ) ;
81+ expect ( applyExtendsIfSpecified ) . toHaveBeenCalledWith ( cosmiconfigResult . config , filePathBeingLinted ) ;
7982 expect ( applyOverrides ) . toHaveBeenCalledTimes ( 1 ) ;
80- expect ( applyOverrides ) . toHaveBeenCalledWith ( cwd , cosmiconfigResult . filepath , 'rules' , 'overrides' ) ;
83+ expect ( applyOverrides ) . toHaveBeenCalledWith ( cwd , filePathBeingLinted , 'rules' , 'overrides' ) ;
8184 } ) ;
8285 } ) ;
8386 } ) ;
0 commit comments