@@ -1389,7 +1389,74 @@ describe('"modules" option', () => {
1389
1389
expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1390
1390
} ) ;
1391
1391
1392
- it ( 'should work and respect the "localConvention" option with the "camelCase" value' , async ( ) => {
1392
+ it ( 'should work and respect the `localConvention` option with the "as-is" value' , async ( ) => {
1393
+ const compiler = getCompiler (
1394
+ "./modules/localsConvention/localsConvention.js" ,
1395
+ {
1396
+ modules : {
1397
+ mode : "local" ,
1398
+ exportLocalsConvention : "as-is" ,
1399
+ } ,
1400
+ } ,
1401
+ ) ;
1402
+ const stats = await compile ( compiler ) ;
1403
+
1404
+ expect (
1405
+ getModuleSource ( "./modules/localsConvention/localsConvention.css" , stats ) ,
1406
+ ) . toMatchSnapshot ( "module" ) ;
1407
+ expect ( getExecutedCode ( "main.bundle.js" , compiler , stats ) ) . toMatchSnapshot (
1408
+ "result" ,
1409
+ ) ;
1410
+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
1411
+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1412
+ } ) ;
1413
+
1414
+ it ( "should work and respect the `localConvention` option with the `as-is` value and `namedExport` is `false`" , async ( ) => {
1415
+ const compiler = getCompiler (
1416
+ "./modules/localsConvention/localsConvention.js" ,
1417
+ {
1418
+ modules : {
1419
+ mode : "local" ,
1420
+ exportLocalsConvention : "as-is" ,
1421
+ namedExport : false ,
1422
+ } ,
1423
+ } ,
1424
+ ) ;
1425
+ const stats = await compile ( compiler ) ;
1426
+
1427
+ expect (
1428
+ getModuleSource ( "./modules/localsConvention/localsConvention.css" , stats ) ,
1429
+ ) . toMatchSnapshot ( "module" ) ;
1430
+ expect ( getExecutedCode ( "main.bundle.js" , compiler , stats ) ) . toMatchSnapshot (
1431
+ "result" ,
1432
+ ) ;
1433
+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
1434
+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1435
+ } ) ;
1436
+
1437
+ it ( "should work and respect the `localConvention` option with the `camelCase` value" , async ( ) => {
1438
+ const compiler = getCompiler (
1439
+ "./modules/localsConvention/localsConvention.js" ,
1440
+ {
1441
+ modules : {
1442
+ mode : "local" ,
1443
+ exportLocalsConvention : "camelCase" ,
1444
+ } ,
1445
+ } ,
1446
+ ) ;
1447
+ const stats = await compile ( compiler ) ;
1448
+
1449
+ expect (
1450
+ getModuleSource ( "./modules/localsConvention/localsConvention.css" , stats ) ,
1451
+ ) . toMatchSnapshot ( "module" ) ;
1452
+ expect ( getExecutedCode ( "main.bundle.js" , compiler , stats ) ) . toMatchSnapshot (
1453
+ "result" ,
1454
+ ) ;
1455
+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
1456
+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1457
+ } ) ;
1458
+
1459
+ it ( "should work and respect the `localConvention` option with the `camelCase` value and `namedExport` false" , async ( ) => {
1393
1460
const compiler = getCompiler (
1394
1461
"./modules/localsConvention/localsConvention.js" ,
1395
1462
{
@@ -1412,7 +1479,7 @@ describe('"modules" option', () => {
1412
1479
expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1413
1480
} ) ;
1414
1481
1415
- it ( ' should work and respect the " localConvention" option with the " camel-case-only" value' , async ( ) => {
1482
+ it ( " should work and respect the ` localConvention` option with the ` camel-case-only` value" , async ( ) => {
1416
1483
const compiler = getCompiler (
1417
1484
"./modules/localsConvention/localsConvention.js" ,
1418
1485
{
@@ -1434,7 +1501,52 @@ describe('"modules" option', () => {
1434
1501
expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1435
1502
} ) ;
1436
1503
1437
- it ( 'should work and respect the "localConvention" option with the "dashes" value' , async ( ) => {
1504
+ it ( "should work and respect the `localConvention` option with the `camel-case-only` value and `namedExport` false" , async ( ) => {
1505
+ const compiler = getCompiler (
1506
+ "./modules/localsConvention/localsConvention.js" ,
1507
+ {
1508
+ modules : {
1509
+ mode : "local" ,
1510
+ exportLocalsConvention : "camel-case-only" ,
1511
+ namedExport : false ,
1512
+ } ,
1513
+ } ,
1514
+ ) ;
1515
+ const stats = await compile ( compiler ) ;
1516
+
1517
+ expect (
1518
+ getModuleSource ( "./modules/localsConvention/localsConvention.css" , stats ) ,
1519
+ ) . toMatchSnapshot ( "module" ) ;
1520
+ expect ( getExecutedCode ( "main.bundle.js" , compiler , stats ) ) . toMatchSnapshot (
1521
+ "result" ,
1522
+ ) ;
1523
+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
1524
+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1525
+ } ) ;
1526
+
1527
+ it ( "should work and respect the `localConvention` option with the `dashes` value" , async ( ) => {
1528
+ const compiler = getCompiler (
1529
+ "./modules/localsConvention/localsConvention.js" ,
1530
+ {
1531
+ modules : {
1532
+ mode : "local" ,
1533
+ exportLocalsConvention : "dashes" ,
1534
+ } ,
1535
+ } ,
1536
+ ) ;
1537
+ const stats = await compile ( compiler ) ;
1538
+
1539
+ expect (
1540
+ getModuleSource ( "./modules/localsConvention/localsConvention.css" , stats ) ,
1541
+ ) . toMatchSnapshot ( "module" ) ;
1542
+ expect ( getExecutedCode ( "main.bundle.js" , compiler , stats ) ) . toMatchSnapshot (
1543
+ "result" ,
1544
+ ) ;
1545
+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
1546
+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1547
+ } ) ;
1548
+
1549
+ it ( "should work and respect the `localConvention` option with the `dashes` value and `namedExport` false" , async ( ) => {
1438
1550
const compiler = getCompiler (
1439
1551
"./modules/localsConvention/localsConvention.js" ,
1440
1552
{
@@ -1457,7 +1569,7 @@ describe('"modules" option', () => {
1457
1569
expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1458
1570
} ) ;
1459
1571
1460
- it ( ' should work and respect the " localConvention" option with the " dashesOnly" value' , async ( ) => {
1572
+ it ( " should work and respect the ` localConvention` option with the ` dashesOnly` value" , async ( ) => {
1461
1573
const compiler = getCompiler (
1462
1574
"./modules/localsConvention/localsConvention.js" ,
1463
1575
{
@@ -1479,6 +1591,29 @@ describe('"modules" option', () => {
1479
1591
expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1480
1592
} ) ;
1481
1593
1594
+ it ( "should work and respect the `localConvention` option with the `dashesOnly` value and `namedExport` false" , async ( ) => {
1595
+ const compiler = getCompiler (
1596
+ "./modules/localsConvention/localsConvention.js" ,
1597
+ {
1598
+ modules : {
1599
+ mode : "local" ,
1600
+ exportLocalsConvention : "dashesOnly" ,
1601
+ namedExport : false ,
1602
+ } ,
1603
+ } ,
1604
+ ) ;
1605
+ const stats = await compile ( compiler ) ;
1606
+
1607
+ expect (
1608
+ getModuleSource ( "./modules/localsConvention/localsConvention.css" , stats ) ,
1609
+ ) . toMatchSnapshot ( "module" ) ;
1610
+ expect ( getExecutedCode ( "main.bundle.js" , compiler , stats ) ) . toMatchSnapshot (
1611
+ "result" ,
1612
+ ) ;
1613
+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
1614
+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
1615
+ } ) ;
1616
+
1482
1617
it ( 'should work and respect the "exportLocalsConvention" option with the "function" type' , async ( ) => {
1483
1618
const compiler = getCompiler (
1484
1619
"./modules/localsConvention/localsConvention.js" ,
0 commit comments