Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@uifabric/jest-serializer-merge-styles
Advanced tools
Provides a Jest serializer for @uifabric/merge-styles
which expands class names into css rules.
When using Jest snapshot testing with components that use @uifabric/merge-styles
, class names may be rendered as such in the snapshot (Note the css-2342
generated class name):
<div className='ms-Foo css-2432'>
Hello world
</div>
Using this serializer, the generated css-2342
class name will be auto expanded to the rules resolved by merge-styles:
<div
className=
ms-Foo
{
background-color: #f4f4f4;
box-sizing: border-box;
color: #333333;
cursor: pointer;
}
&:hover {
background-color: #f8f8f8;
}
>
Hello world
</div>
This means that your tests can pass reliably (no generated class names) and your rules get included in the snapshot. (Snapshots need updates when css is altered.)
In your jest.config.js (or appropriate config location) include a snapshotSerializers
array that references this package:
module.exports = {
snapshotSerializers: [path.resolve(__dirname, 'jest-serializer-merge-styles')],
};
See Testing for more detailed usage.
FAQs
Jest serializer for merge-styles.
The npm package @uifabric/jest-serializer-merge-styles receives a total of 202 weekly downloads. As such, @uifabric/jest-serializer-merge-styles popularity was classified as not popular.
We found that @uifabric/jest-serializer-merge-styles demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.