freeCodeCamp/guide/chinese/miscellaneous/chaijs-assertexpression-mes.../index.md

457 B

title localeTitle
Chaijs Assertexpression Message Chaijs AssertExpression消息

@param {Mixed}表达式来测试真实性

  • @param {String}消息显示错误

编写自己的测试表达式。

assert('foo' !== 'bar', 'foo is not bar'); 
 assert(Array.isArray(<a href='http://chaijs.com/api/assert/' target='_blank' rel='nofollow'>]), 'empty arrays are arrays'); 

细节:[http://chaijs.com/api/assert/