Skip to content

Commit 0ed6afd

Browse files
committed
Tweak matcher
1 parent 7a46e44 commit 0ed6afd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jest/custom-matchers.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ expect.extend({
107107
printWidth: 100,
108108
})
109109
}
110+
111+
function stripped(str) {
112+
return str.replace(/\/\* ! tailwindcss .* \*\//, '').replace(/\s/g, '').replace(/;/g, '')
113+
}
114+
110115
const options = {
111116
comment: 'stripped(received) === stripped(argument)',
112117
isNot: this.isNot,
@@ -116,7 +121,7 @@ expect.extend({
116121
let formattedReceived = format(received)
117122
let formattedArgument = format(argument)
118123

119-
const pass = formattedReceived === formattedArgument
124+
const pass = stripped(formattedReceived) === stripped(formattedArgument)
120125

121126
const message = pass
122127
? () => {

0 commit comments

Comments
 (0)