Jasmine
- 4. 开发量的变化
Server Browser
Server Browser
- 6. 困难重重
• 浪费太多时间
How? • 效率太低,意义不大
• 从没写过javascript的单元测试
- 17. Spies matchers
• expect(x).toHaveBeenCalled();
• expect(x).toHaveBeenCalledWith(arguments);
• expect(x).not.toHaveBeenCalled();
• expect(x).not.toHaveBeenCalledWith(argume
nts);
- 18. Spies
• spyOn(x, 'method').andCallThrough();
• spyOn(x, 'method').andReturn(arguments);
• spyOn(x, 'method').andThrow(exception);
• spyOn(x, 'method').andCallFake(function);
• spyOn(x, 'method').andReturn(value1); ... ;
x.method.andReturn(value2);