Skip to content

dcwither/jest-postcss

Repository files navigation

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()

About

Jest utils for postcss plugins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published