Jasmine Testing Framework Whats Jasmine For Framework for

  • Slides: 13
Download presentation
Jasmine Testing Framework

Jasmine Testing Framework

What’s Jasmine For? • Framework for Test Driven Development • Designed around acceptance testing

What’s Jasmine For? • Framework for Test Driven Development • Designed around acceptance testing • Works in any environment (with or without browser, etc. )

What does Jasmine look like?

What does Jasmine look like?

How do I use Jasmine? • First: define your behavior • Example: Citadel Trivia

How do I use Jasmine? • First: define your behavior • Example: Citadel Trivia App • Should provide information about the citadel • Should be location aware • Second: define your interface • Example: Citadel Trivia App • HTML 5 Page • Three important elements: title div, content div and update button • Clicking the update button should put information in the two divs • The information should change if the user is in a new area

Citadel Trivia App HTML Skeleton

Citadel Trivia App HTML Skeleton

How do I write a test?

How do I write a test?

What do the test results look like?

What do the test results look like?

What about when they fail?

What about when they fail?

How do I use dummy results?

How do I use dummy results?

And the results?

And the results?

What does the testing driver look like?

What does the testing driver look like?

How do I get started? 1. Go to http: //pivotal. github. io/jasmine/ 2. Scroll

How do I get started? 1. Go to http: //pivotal. github. io/jasmine/ 2. Scroll to the bottom of the page 3. Download “Standalone Release” 4. Extract all files 5. Modify the Spec. Runner. html to include your own files and structure

What are some other tools? • QUnit: an alternative to Jasmine (http: //qunitjs. com/)

What are some other tools? • QUnit: an alternative to Jasmine (http: //qunitjs. com/) • JSCover: A code coverage tool (http: //tntim 96. github. io/JSCover/) • Phantom. JS: a ‘headless’ JS environment --good for automatically running tests (http: //phantomjs. org/)