Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ChaiJS Should - test for empty string

According to docs on the shouldJS site I should be able to do this:

''.should.be.empty();

The ChaiJS site doesn't have an example with should syntax, but it lists it for expect and it seems that the above example would work.

However this yields:

TypeError: Property 'empty' of object #<Assertion> is not a function

What is syntax for the Chai lib empty() with should style?

like image 340
cyberwombat Avatar asked May 20 '14 18:05

cyberwombat


1 Answers

Just remove the parens - instead of empty(), use empty:

''.should.be.empty;

Further Reading: Docs on Empty

like image 136
Sergey K Avatar answered Oct 16 '22 15:10

Sergey K