From: Evan You Date: Thu, 19 Dec 2019 17:07:47 +0000 (-0500) Subject: test(sfc): test @media and @supports query for scoped css X-Git-Tag: v3.0.0-alpha.0~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c73d889235485a9249b13bbf48095502a0bc800f;p=thirdparty%2Fvuejs%2Fcore.git test(sfc): test @media and @supports query for scoped css --- diff --git a/packages/compiler-sfc/__tests__/stylePluginScoped.spec.ts b/packages/compiler-sfc/__tests__/stylePluginScoped.spec.ts index a618ef618e..ed24199a50 100644 --- a/packages/compiler-sfc/__tests__/stylePluginScoped.spec.ts +++ b/packages/compiler-sfc/__tests__/stylePluginScoped.spec.ts @@ -91,6 +91,18 @@ describe('SFC scoped CSS', () => { ) }) + test('media query', () => { + expect(compile(`@media print { .foo { color: red }}`)).toMatch( + /@media print {\s+\.foo\[test\] \{ color: red/ + ) + }) + + test('supports query', () => { + expect( + compile(`@supports(display: grid) { .foo { display: grid }}`) + ).toMatch(/@supports\(display: grid\) {\s+\.foo\[test\] \{ display: grid/) + }) + test('scoped keyframes', () => { const style = compile(` .anim {