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 ); });