Skip to content

Commit

Permalink
fix: Improve toHaveClass error message format (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
akrifari authored Dec 6, 2021
1 parent 6f69437 commit a9beb47
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/to-have-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ export function toHaveClass(htmlElement, ...params) {
const to = this.isNot ? 'not to' : 'to'
return getMessage(
this,
this.utils.matcherHint(
`${this.isNot ? '.not' : ''}.toHaveClass`,
'element',
this.utils.printExpected(expected.join(' ')),
),
`Expected the element ${to} have EXACTLY defined classes`,
expected.join(' '),
'Received',
Expand Down

0 comments on commit a9beb47

Please sign in to comment.