Skip to content

Commit

Permalink
run prettier on failing tests for toMatchFormattedCss
Browse files Browse the repository at this point in the history
This will result in better diffs because diffs are typically per block
and/or per line. But lightningcss will simplify certain selectors and
the diff won't be as clear.

We will only apply the prettier formatting for failing tests in the diff
view so that diffs are cleaner and we don't pay for the additional
prettier calls when tests pass.
  • Loading branch information
RobinMalfait committed Jan 23, 2023
1 parent df1a93e commit 7227d0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jest/customMatchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ function toMatchFormattedCss(received = '', argument = '') {
)
}
: () => {
let actual = formattedReceived
let expected = formattedArgument
let actual = formatPrettier(formattedReceived)
let expected = formatPrettier(formattedArgument)

let diffString = diff(expected, actual, {
expand: this.expand,
Expand Down

0 comments on commit 7227d0f

Please sign in to comment.