jest-postcss
v0.1.0
Published
Jest utils for postcss plugins
Downloads
6,325
Readme
jest-postcss
Jest utils for postcss plugins
Installation
npm install --save-dev jest-postcss
Usage
Import jest-postcss
into your test setup once.
import "jest-postcss"
Matchers
.toMatchCSS
toMatchCSS(css: string)
Compares the postcss result css against the Provided CSS
expect(
await postcss(plugins).process()
).toMatchCSS(`
.your-css {}
`)
Snapshot Serializers
Allows use of snapshot testing with postcss results, pretifying the CSS for consistency.
expect(
await postcss(plugins).process()
).toMatchSnapshot()
expect(
await postcss(plugins).process()
).toMatchInlineSnapshot()