jest-postcss
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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

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

Dependencies (0)

    Dev Dependencies (20)

    Package Sidebar

    Install

    npm i jest-postcss

    Weekly Downloads

    876

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    5.56 kB

    Total Files

    9

    Last publish

    Collaborators

    • dcwither