File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ module.exports = async ({ source, localIdentName }) => {
99 localIdentName,
1010 } )
1111 ] ,
12- { filename : 'App.svelte' }
12+ { filename : 'src/ App.svelte' }
1313 ) ;
1414
1515 return code ;
Original file line number Diff line number Diff line change 1+ const compiler = require ( './compiler.js' ) ;
2+
3+ const source = '<style>.red { color: red; }</style>\n<span class="$style.red">Red</span>' ;
4+ const sourceReactiveClass = '<style>.red { color: red; }</style>\n<span class:$.red={true}>Red</span>' ;
5+
6+ test ( 'Replace path on regular class' , async ( ) => {
7+ const output = await compiler ( {
8+ source,
9+ localIdentName : '[path][name]__[local]' ,
10+ } ) ;
11+
12+ expect ( output ) . toBe ( '<style>:global(.src_App__red) { color: red; }</style>\n<span class="src_App__red">Red</span>' ) ;
13+ } ) ;
14+
15+ test ( 'Replace path on reactive class' , async ( ) => {
16+ const output = await compiler ( {
17+ source : sourceReactiveClass ,
18+ localIdentName : '[path][name]__[local]' ,
19+ } ) ;
20+
21+ expect ( output ) . toBe ( '<style>:global(.src_App__red) { color: red; }</style>\n<span class:src_App__red={true}>Red</span>' ) ;
22+ } ) ;
You can’t perform that action at this time.
0 commit comments