@@ -6,6 +6,7 @@ const sourceShorthand = '<style>.red { color: red; }</style>\n<span class="$.red
66test ( 'Generate CSS Modules from HTML attributes, Replace CSS className' , async ( ) => {
77 const output = await compiler ( {
88 source,
9+ } , {
910 localIdentName : '[local]-123456' ,
1011 } ) ;
1112
@@ -14,6 +15,7 @@ test('Generate CSS Modules from HTML attributes, Replace CSS className', async (
1415test ( '[Shorthand] Generate CSS Modules from HTML attributes, Replace CSS className' , async ( ) => {
1516 const output = await compiler ( {
1617 source : sourceShorthand ,
18+ } , {
1719 localIdentName : '[local]-123456' ,
1820 } ) ;
1921
@@ -23,13 +25,15 @@ test('[Shorthand] Generate CSS Modules from HTML attributes, Replace CSS classNa
2325test ( 'Avoid generated class to start with a non character' , async ( ) => {
2426 const output = await compiler ( {
2527 source,
28+ } , {
2629 localIdentName : '1[local]' ,
2730 } ) ;
2831 expect ( output ) . toBe ( '<style>:global(._1red) { color: red; }</style>\n<span class="_1red">Red</span>' ) ;
2932} ) ;
3033test ( '[Shorthand] Avoid generated class to start with a non character' , async ( ) => {
3134 const output = await compiler ( {
3235 source : sourceShorthand ,
36+ } , {
3337 localIdentName : '1[local]' ,
3438 } ) ;
3539 expect ( output ) . toBe ( '<style>:global(._1red) { color: red; }</style>\n<span class="_1red">Red</span>' ) ;
@@ -38,13 +42,15 @@ test('[Shorthand] Avoid generated class to start with a non character', async ()
3842test ( 'Avoid generated class to end with a hyphen' , async ( ) => {
3943 const output = await compiler ( {
4044 source,
45+ } , {
4146 localIdentName : '[local]-' ,
4247 } ) ;
4348 expect ( output ) . toBe ( '<style>:global(.red) { color: red; }</style>\n<span class="red">Red</span>' ) ;
4449} ) ;
4550test ( '[Shorthand] Avoid generated class to end with a hyphen' , async ( ) => {
4651 const output = await compiler ( {
4752 source : sourceShorthand ,
53+ } , {
4854 localIdentName : '[local]-' ,
4955 } ) ;
5056 expect ( output ) . toBe ( '<style>:global(.red) { color: red; }</style>\n<span class="red">Red</span>' ) ;
0 commit comments