mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
22 lines
560 B
JavaScript
22 lines
560 B
JavaScript
expect.extend({
|
|
// Compare two CSS strings with all whitespace removed
|
|
// This is probably naive but it's fast and works well enough.
|
|
toMatchCss(received, argument) {
|
|
function stripped(str) {
|
|
return str.replace(/\s/g, '')
|
|
}
|
|
|
|
if (stripped(received) === stripped(argument)) {
|
|
return {
|
|
message: () => `expected ${received} not to match CSS ${argument}`,
|
|
pass: true,
|
|
}
|
|
} else {
|
|
return {
|
|
message: () => `expected ${received} to match CSS ${argument}`,
|
|
pass: false,
|
|
}
|
|
}
|
|
},
|
|
})
|