0
我很感激學習如何使用and
吸氣劑在Chai語言鏈的一部分幫助。我曾嘗試這樣的代碼:
describe ('', function() {
it ('', function() {
expect(myVariable).to.be.a('number').and.not.a(NaN);
expect(myVariable).to.be.a('number').and.not.to.be.a(NaN);
}
}
但在以下錯誤消息兩個表達式的結果:
TypeError: type.toLowerCase is not a function
問題
如何正確使用and
吸氣,以測試是否myVariable
是一個"number"
,並在同一時間確保它不是一個NaN
?