How to assert not null?

后端 未结 3 1155
[愿得一人]
[愿得一人] 2021-02-11 12:53

I\'m very new in javascript testing, I would like to know how to assert not null in Mocha framework.

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-11 13:39

    This is what worked for me (using Expect library with Mocha):

    expect(myObject).toExist('Too bad when it does not.');
    

提交回复
热议问题