From 5a332a03a1dd8b242964d1231e5b53b9ee68ec1e Mon Sep 17 00:00:00 2001 From: linzhe141 <1572213544@qq.com> Date: Thu, 12 Sep 2024 10:22:51 +0800 Subject: [PATCH] chore: update test --- .../__tests__/compileStyle.spec.ts | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/compiler-sfc/__tests__/compileStyle.spec.ts b/packages/compiler-sfc/__tests__/compileStyle.spec.ts index 72727c43196..10dbacdbfb7 100644 --- a/packages/compiler-sfc/__tests__/compileStyle.spec.ts +++ b/packages/compiler-sfc/__tests__/compileStyle.spec.ts @@ -42,8 +42,27 @@ describe('SFC scoped CSS', () => { }) test('nesting selector', () => { - expect(compileScoped(`h1 { color: red; .foo { color: red; } }`)).toMatch( - `h1 {\n&[data-v-test] { color: red;\n}\n.foo[data-v-test] { color: red;`, + expect( + compileScoped( + 'h1 { \n' + + ' color: red; \n' + + ' /**background-color: pink; */ \n' + + ' @media only screen and (max-width: 800px) { \n' + + ' background-color: green; \n' + + ' } \n' + + ' .foo { color: red; }' + + '} \n', + ), + ).toMatch( + `h1 { +&[data-v-test] { + color: red; + /**background-color: pink; */ +@media only screen and (max-width: 800px) { + background-color: green; +}} +.foo[data-v-test] { color: red; +}} `, ) })