lesson6 fibonacci 测试用例中缺少对NaN类型的判断

作者: stanxlab创建于 2016年10月20日更新于 2019年12月17日

As the title suggests, the following test case fails: it('should throw when n isnt Number', function () { (function () { var a = 'asd'; a = parseInt(a); main.fibonacci(a); }) .should.throw('n should be a Number'); }); If you run node main.js directly, you will find that it is in an infinite loop. It turns out that typeof NaN === 'number', haha.

内容来源: alsotang/node-lessons