@@ -100,19 +100,6 @@ describe("browserslist", () => {
100100 ) . toEqual ( { chrome : "80.0.0" } ) ;
101101 } ) ;
102102
103- // TODO: browserslistConfig is currently resolved starting from the root
104- // rather than from the config file.
105- // eslint-disable-next-line jest/no-disabled-tests
106- it . skip ( "loads nested .browserslistrc files if explicitly specified" , ( ) => {
107- expect (
108- loadOptions ( {
109- cwd : join ( cwd , "fixtures" , "targets" ) ,
110- filename : "./node_modules/dep/test.js" ,
111- babelrcRoots : [ "./node_modules/dep/" ] ,
112- } ) . targets ,
113- ) . toEqual ( { edge : "14.0.0" } ) ;
114- } ) ;
115-
116103 describe ( "browserslistConfigFile" , ( ) => {
117104 it ( "can disable config loading" , ( ) => {
118105 expect (
@@ -132,16 +119,26 @@ describe("browserslist", () => {
132119 ) . toEqual ( { firefox : "74.0.0" } ) ;
133120 } ) ;
134121
135- it ( "is relative to the project root" , ( ) => {
122+ it ( "is relative to the cwd even if specifying ' root' " , ( ) => {
136123 expect (
137124 loadOptions ( {
138125 cwd : join ( cwd , "fixtures" , "targets" ) ,
139126 root : ".." ,
140127 filename : "./nested/test.js" ,
141- browserslistConfigFile : "./targets/ .browserslistrc-firefox" ,
128+ browserslistConfigFile : "./.browserslistrc-firefox" ,
142129 } ) . targets ,
143130 ) . toEqual ( { firefox : "74.0.0" } ) ;
144131 } ) ;
132+
133+ it ( "is relative to the config files that defines it" , ( ) => {
134+ expect (
135+ loadOptions ( {
136+ cwd : join ( cwd , "fixtures" , "targets" ) ,
137+ filename : "./node_modules/dep/test.js" ,
138+ babelrcRoots : [ "./node_modules/dep/" ] ,
139+ } ) . targets ,
140+ ) . toEqual ( { edge : "14.0.0" } ) ;
141+ } ) ;
145142 } ) ;
146143
147144 describe ( "browserslistEnv" , ( ) => {
0 commit comments