Skip to content
This repository was archived by the owner on Dec 15, 2024. It is now read-only.

benface/jest-matcher-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSS Matcher for Jest

Installation

npm install jest-matcher-css

Usage

In your Jest config:

"jest": {
  "setupTestFrameworkScriptFile": "./setup.js"
}

In setup.js:

const cssMatcher = require('jest-matcher-css');

expect.extend({
  toMatchCss: cssMatcher,
});

Credit

Written by Adam Wathan for Tailwind CSS. I moved it into its own module to use it in a couple of Tailwind plugins.

About

Jest matcher to assert that a string of CSS matches another one

Resources

Stars

Watchers

Forks

Packages

No packages published