12

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?

Ruslan Zhomir
  • 842
  • 9
  • 27
cyberwombat
  • 38,105
  • 35
  • 175
  • 251

1 Answers1

16

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

''.should.be.empty;

Further Reading: Docs on Empty

KyleMit
  • 30,350
  • 66
  • 462
  • 664
Lukas S.
  • 5,698
  • 5
  • 35
  • 50