From afee4495d520d34dbed9f6177b6ee3001aa7a7cc Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Thu, 16 Nov 2017 07:52:30 -0500 Subject: [PATCH] Add test to document that applying classes with pseudo-selectors is not supported --- __tests__/applyAtRule.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/__tests__/applyAtRule.test.js b/__tests__/applyAtRule.test.js index 5c0e96b26..1bd33e0c7 100644 --- a/__tests__/applyAtRule.test.js +++ b/__tests__/applyAtRule.test.js @@ -37,5 +37,21 @@ test('applying classes that are ever used in a media query is not supported', () test('it fails if the class does not exist', () => { run('.b { @apply .a; }').catch(error => { expect(error.reason).toEqual('No .a class found.') +test('it does not match classes that include pseudo-selectors', () => { + const input = ` + .a:hover { + color: red; + } + + .b { + @apply .a; + } + ` + expect.assertions(1) + return run(input).catch(e => { + expect(e).toMatchObject({ name: 'CssSyntaxError' }) + }) +}) + }) })