File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 55 compressSymbols ,
66} from '../../src/minify'
77
8+ import { makePlaceholder } from '../../src/css/placeholderUtils'
9+
810describe ( 'minify utils' , ( ) => {
911 describe ( 'stripLineComment' , ( ) => {
1012 it ( 'splits a line by potential comment starts and joins until one is an actual comment' , ( ) => {
@@ -75,6 +77,18 @@ describe('minify utils', () => {
7577 expect ( actual ) . toBe ( expected )
7678 expect ( actual ) . toBe ( minifyCooked ( input ) [ 0 ] )
7779 } )
80+
81+ it ( 'Returns the indices of removed placeholders (expressions)' , ( ) => {
82+ const placeholder1 = makePlaceholder ( 0 )
83+ const placeholder2 = makePlaceholder ( 1 )
84+ const input = `this is some\ninput with ${ placeholder1 } and // ignored ${ placeholder2 } `
85+ const expected = `this is some input with ${ placeholder1 } and `
86+ const [ actual , indices ] = minifyRaw ( input )
87+
88+ expect ( actual ) . toBe ( expected )
89+ expect ( indices ) . toEqual ( [ 1 ] )
90+ expect ( minifyCooked ( input ) ) . toEqual ( [ actual , [ 1 ] ] )
91+ } )
7892 } )
7993
8094 describe ( 'minifyRaw' , ( ) => {
You can’t perform that action at this time.
0 commit comments