File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,32 @@ describe('transform typescript template', () => {
184
184
expect ( output ) . toBe ( `'test'` )
185
185
} )
186
186
187
+ it ( 'handles quotes in interpolations' , async ( ) => {
188
+ expect (
189
+ await fixture ( `
190
+ <template>
191
+ <div>
192
+ <div :class="$test('foobar', \`Foobar 'test'\`)" />
193
+ <div>{{ $test('foobar', "Foobar 'test'") }}</div>
194
+ <div>{{ $test('foobar', 'Foobar test') }}</div>
195
+ <div>{{ $test('foobar', \`Foobar ' " ''" test\`) }}</div>
196
+ </div>
197
+ </template>
198
+ ` ) ,
199
+ ) . toMatchInlineSnapshot ( `
200
+ "
201
+ <template>
202
+ <div>
203
+ <div :class="$test('foobar', \`Foobar \\'test\\'\`)" />
204
+ <div>{{ $test("foobar", "Foobar \\"test\\"") }}</div>
205
+ <div>{{ $test("foobar", "Foobar test") }}</div>
206
+ <div>{{ $test("foobar", \`Foobar ' " ''" test\`) }}</div>
207
+ </div>
208
+ </template>
209
+ "
210
+ ` )
211
+ } )
212
+
187
213
async function fixture ( src : string ) {
188
214
const requireFromVue = createRequire ( resolveModulePath ( 'vue' ) )
189
215
const { parse } = requireFromVue ( '@vue/compiler-dom' ) as typeof import ( '@vue/compiler-dom' )
You can’t perform that action at this time.
0 commit comments