From a9beb47455dae0f455ddacc473d0ddabe09f0b43 Mon Sep 17 00:00:00 2001 From: Krisan Alifari Date: Mon, 6 Dec 2021 19:03:18 +0700 Subject: [PATCH] fix: Improve `toHaveClass` error message format (#405) --- src/to-have-class.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/to-have-class.js b/src/to-have-class.js index b9ff0fee..be59be3a 100644 --- a/src/to-have-class.js +++ b/src/to-have-class.js @@ -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',