Jasmine test fails when run in Chutzpah but not in browser
I have a test that carries over fine in the browser, but doesn't work in Chutzpah.
Here's the part that fails:
var nameLowerCase = person.PersonName.toLowerCase();
var searchLowerCase= search.toLowerCase();
return (nameLowerCase.includes(searchLowerCase));
Chutzpach says:
Message: TypeError: undefined is not a constructor (evaluating 'nameLowerCase.includes (searchLowerCase)') ...
It seems that the problem is with the function includes
, because if I remove it, it will run.
I'll probably try to replace this functionality with Regex or something, but it was a huge pain trying to track this down. If I'm missing something stupid I would like it to point to me.
+3
source to share
2 answers