Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
根据shouldJS网站上的文档,我应该能够做到这一点:
''.should.be.empty();
ChaiJS站点没有 should 语法的示例,但它为expect列出了它,并且上面的示例似乎可以工作。
然而,这会产生:
TypeError: Property 'empty' of object #<Assertion> is not a function
empty()具有should样式的 Chai 库的语法是什么?
empty()
只需删除括号 - 而不是empty()使用empty:
empty
''.should.be.empty;
延伸阅读:关于文档Empty
Empty