@@ -14,7 +14,7 @@ describe("bundling", _ => {
1414 } ] ;
1515 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
1616
17- return faucetJS ( config , assetManager ) .
17+ return faucetJS ( config , assetManager , { browsers : { } } ) .
1818 then ( _ => {
1919 assetManager . assertWrites ( [ {
2020 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -35,7 +35,7 @@ console.log(\`[…] $\{util}\`); // eslint-disable-line no-console
3535 } ] ;
3636 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
3737
38- return faucetJS ( config , assetManager ) .
38+ return faucetJS ( config , assetManager , { browsers : { } } ) .
3939 then ( _ => {
4040 assetManager . assertWrites ( [ {
4141 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -62,7 +62,7 @@ console.log("[\\u2026] " + util); // eslint-disable-line no-console
6262 } ] ;
6363 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
6464
65- return faucetJS ( config , assetManager ) .
65+ return faucetJS ( config , assetManager , { browsers : { } } ) .
6666 then ( restore , restore ) . // XXX: hacky
6767 then ( _ => {
6868 assetManager . assertWrites ( [ {
@@ -103,7 +103,7 @@ console.log("[\\u2026] " + dist); // eslint-disable-line no-console
103103 } ] ;
104104 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
105105
106- return faucetJS ( config , assetManager ) .
106+ return faucetJS ( config , assetManager , { browsers : { } } ) .
107107 then ( _ => {
108108 assetManager . assertWrites ( [ {
109109 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -124,7 +124,7 @@ console.log(\`[…] $\{helper}\`); // eslint-disable-line no-console
124124 } ] ;
125125 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
126126
127- return faucetJS ( config , assetManager ) .
127+ return faucetJS ( config , assetManager , { browsers : { } } ) .
128128 then ( _ => {
129129 assetManager . assertWrites ( [ {
130130 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -149,7 +149,7 @@ return lib;
149149 } ] ;
150150 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
151151
152- return faucetJS ( config , assetManager ) .
152+ return faucetJS ( config , assetManager , { browsers : { } } ) .
153153 then ( _ => {
154154 assetManager . assertWrites ( [ {
155155 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -181,7 +181,7 @@ return lib;
181181 } ] ;
182182 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
183183
184- return faucetJS ( config , assetManager ) .
184+ return faucetJS ( config , assetManager , { browsers : { } } ) .
185185 then ( _ => {
186186 assetManager . assertWrites ( [ {
187187 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -202,7 +202,7 @@ console.log(\`[…] $\{MYLIB}\`); // eslint-disable-line no-console
202202 } ] ;
203203 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
204204
205- return faucetJS ( config , assetManager ) .
205+ return faucetJS ( config , assetManager , { browsers : { } } ) .
206206 then ( _ => {
207207 assetManager . assertWrites ( [ {
208208 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -232,7 +232,8 @@ console.log(\`[…] $\{MYLIB}\`); // eslint-disable-line no-console
232232 } ] ;
233233 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
234234
235- return faucetJS ( config , assetManager , { browsers : [ "Chrome 63" ] } ) .
235+ let browsers = { defaults : [ "Chrome 63" ] } ;
236+ return faucetJS ( config , assetManager , { browsers } ) .
236237 then ( _ => {
237238 assetManager . assertWrites ( [ {
238239 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -255,7 +256,8 @@ console.log(\`[…] $\{util}\`); // eslint-disable-line no-console
255256 } ] ;
256257 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
257258
258- return faucetJS ( config , assetManager , { browsers : [ "Chrome 63" ] } ) .
259+ let browsers = { defaults : [ "Chrome 63" ] } ;
260+ return faucetJS ( config , assetManager , { browsers } ) .
259261 then ( _ => {
260262 assetManager . assertWrites ( [ {
261263 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -268,17 +270,21 @@ console.log("[\\u2026] " + util); // eslint-disable-line no-console
268270 } ) ;
269271 } ) ;
270272
271- it ( "should allow specifying an alternative Browserslist directory " , ( ) => {
273+ it ( "should allow specifying an alternative Browserslist group " , ( ) => {
272274 let config = [ {
273275 source : "./src/index.js" ,
274276 target : "./dist/bundle.js" ,
275277 esnext : {
276- browserslist : "./alt "
278+ browserslist : "modern "
277279 }
278280 } ] ;
279281 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
280282
281- return faucetJS ( config , assetManager , { browsers : [ "IE 11" ] } ) .
283+ let browsers = {
284+ defaults : [ "IE 11" ] ,
285+ modern : [ "Chrome 63" ]
286+ } ;
287+ return faucetJS ( config , assetManager , { browsers } ) .
282288 then ( _ => {
283289 assetManager . assertWrites ( [ {
284290 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -298,7 +304,7 @@ console.log(\`[…] $\{util}\`); // eslint-disable-line no-console
298304 } ] ;
299305 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
300306
301- return faucetJS ( config , assetManager , { compact : true } ) .
307+ return faucetJS ( config , assetManager , { browsers : { } , compact : true } ) .
302308 then ( _ => {
303309 assetManager . assertWrites ( [ {
304310 filepath : path . resolve ( FIXTURES_DIR , "./dist/bundle.js" ) ,
@@ -311,7 +317,7 @@ console.log(\`[…] $\{util}\`);
311317
312318 config [ 0 ] . esnext = true ;
313319 assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
314- return faucetJS ( config , assetManager , { compact : true } ) ;
320+ return faucetJS ( config , assetManager , { browsers : { } , compact : true } ) ;
315321 } ) .
316322 then ( _ => {
317323 assetManager . assertWrites ( [ {
@@ -325,7 +331,7 @@ console.log("[\\u2026] " + util);
325331
326332 config [ 0 ] . compact = false ; // overrides global option
327333 assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
328- return faucetJS ( config , assetManager , { compact : true } ) ;
334+ return faucetJS ( config , assetManager , { browsers : { } , compact : true } ) ;
329335 } ) .
330336 then ( _ => {
331337 assetManager . assertWrites ( [ {
@@ -343,7 +349,8 @@ console.log("[\\u2026] " + util); // eslint-disable-line no-console
343349 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
344350 let entryPoint = "src/index.js" ;
345351 let target = "dist/bundle.js" ;
346- let compile = ( source , target ) => faucetJS ( [ { source, target } ] , assetManager ) ;
352+ let compile = ( source , target ) => faucetJS ( [ { source, target } ] ,
353+ assetManager , { browsers : { } } ) ;
347354
348355 let fn = _ => compile ( `./${ entryPoint } ` , target ) ;
349356 assert . throws ( fn , / p a t h m u s t b e r e l a t i v e / ) ;
@@ -360,7 +367,8 @@ console.log("[\\u2026] " + util); // eslint-disable-line no-console
360367 let entryPoint = "dummy/src/index.js" ;
361368 let target = "./dist/bundle.js" ;
362369 let assetManager = new MockAssetManager ( FIXTURES_DIR ) ;
363- let compile = ( source , target ) => faucetJS ( [ { source, target } ] , assetManager ) ;
370+ let compile = ( source , target ) => faucetJS ( [ { source, target } ] ,
371+ assetManager , { browsers : { } } ) ;
364372
365373 return compile ( entryPoint , target ) .
366374 then ( _ => {
0 commit comments