From fcbbc236c40470134b9532fa90b35e952eabe3d6 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Wed, 13 Nov 2019 10:43:47 +0100 Subject: [PATCH] Fix method `text` to work with other types then strings --- chai-jquery.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chai-jquery.js b/chai-jquery.js index ed54a66..58294dc 100644 --- a/chai-jquery.js +++ b/chai-jquery.js @@ -126,11 +126,12 @@ chai.Assertion.addMethod('text', function (text) { var actual = flag(this, 'object').text(); + var expected = text.toString() this.assert( - actual === text + actual === expected , 'expected #{this} to have text #{exp}, but the text was #{act}' , 'expected #{this} not to have text #{exp}' - , text + , expected , actual ); });