compiled
compiled copied to clipboard
Asserting CSS shorthands in the jest matcher doesn't work
Because of the introduction of #320 the jest matcher now will fail when asserting some short hands, for example:
const Component = styled.div`
background: red;
`;
// ...
expect(actual).toHaveCompiledCss('background', 'red');
Would fail. But:
expect(actual).toHaveCompiledCss('background-color', 'red');
Would pass. Not ideal.
We need to:
- move from
csstopostcssin the matcher and then utilise theexpandplugin we've written in some form. - figure out how to handle some edge cases, for example:
const Component = styled.div`
margin: 0 auto;
margin-left: 10px;
`;
expect(actual).toHaveCompiledCss('margin', '0 auto');
Will fail. Is this OK?