Jasmine
Upcoming SlideShare
Loading in...5
×
 

Jasmine

on

  • 452 views

jasmine入门介绍,by苏河

jasmine入门介绍,by苏河

Statistics

Views

Total Views
452
Views on SlideShare
452
Embed Views
0

Actions

Likes
1
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Jasmine Jasmine Presentation Transcript

    • 苏河
    • • 界面老是改,测毛线• 都是业务代码,测毛线• 项目时间太紧,测毛线• 测毛线,还是目测给力……
    • 产品的变化• RIA• Base on Browser• Heavy Javascript• Html 5
    • 开发量的变化 Server Browser Server Browser
    • 前端关注点的变化 内部质量 外部质量 可维护性 前 功能 性能 端 质 界面 设计模式 量 开发效率
    • 困难重重 • 浪费太多时间How? • 效率太低,意义不大 • 从没写过javascript的单元测试
    • Jasmine• Jasmine是一个BDD的javascript单 元测试框架
    • Jasmine• 语法简单• 代码易读性• 不依赖其他js框架• 敏捷• Nodejs、ruby、java、html
    • Specs
    • Expectations
    • Suites
    • Nested Describes
    • Disabling Tests & Suites
    • Matchers
    • Your matchers
    • Before and After
    • Spies matchers• expect(x).toHaveBeenCalled();• expect(x).toHaveBeenCalledWith(arguments);• expect(x).not.toHaveBeenCalled();• expect(x).not.toHaveBeenCalledWith(argume nts);
    • 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);
    • spies
    • Asynchronous specs
    • waits
    • waitsFor• waitsFor(function, optional message, optional timeout)
    • 爱逛街demo• 是否有问题?
    • 预告片• 如何更好的架构可测试代码• 如何集成到klude测试平台• ……
    • QA