Skip to content

Commit

Permalink
fix: Improve toHaveClass error message format (#405)
Browse files Browse the repository at this point in the history
akrifari authored Dec 6, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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
@@ -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',

0 comments on commit a9beb47

Please sign in to comment.