CSC/ECE 517 Fall 2014/ch1b 26 sa: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 9: Line 9:
* Many don't support testing asynchronous code like event callbacks.  
* Many don't support testing asynchronous code like event callbacks.  
* Some have syntax that's hard for JS developers or IDEs to understand.
* Some have syntax that's hard for JS developers or IDEs to understand.
== Design Principles ==
The Jasmine developer community believes that a good JavaScript testing framework must follow these principles. <ref>https://github.com/pivotal/jasmine/wiki/Background</ref>
* should not be tied to any browser, framework, platform, or host language.
* should have idiomatic and unsurprising syntax.
* should work anywhere JavaScript can run, including browsers, servers, phones, etc.
* shouldn't intrude in your application's territory (e.g. by cluttering the global namespace).
* should play well with IDEs (e.g. test code should pass static analysis).
== Goals ==
The Jasmine framework is written with the objective of meeting these goals.<ref>https://github.com/pivotal/jasmine/wiki/Background</ref>
* it should encourage good testing practices.
* it should integrate easily with continuous build systems.
* it should be simple to get started with.


= Usage =
= Usage =

Revision as of 20:33, 4 October 2014

Jasmine is an open source Behavior Driven Development (BDD) based testing framework for JavaScript. Jasmine aims to run on any Javascript-enabled platform, to not intrude on the application nor the IDE, and to have easy-to-read syntax.

It can be used in the Rails framework. Jasmine ships as a Rubygem and leverages familiar rake tasks and generators to automate common workflows. Jasmine is heavily influenced by other unit testing frameworks, such as ScrewUnit, JSSpec, JSpec, and RSpec; and has syntax very similar to RSpec.

Background

The Jasmine framework was developed since developers to address certain specific concerns in existing testing frameworks <ref>https://github.com/pivotal/jasmine/wiki/Background</ref>

  • Many frameworks only work from within a browser.
  • Many don't support testing asynchronous code like event callbacks.
  • Some have syntax that's hard for JS developers or IDEs to understand.

Design Principles

The Jasmine developer community believes that a good JavaScript testing framework must follow these principles. <ref>https://github.com/pivotal/jasmine/wiki/Background</ref>

  • should not be tied to any browser, framework, platform, or host language.
  • should have idiomatic and unsurprising syntax.
  • should work anywhere JavaScript can run, including browsers, servers, phones, etc.
  • shouldn't intrude in your application's territory (e.g. by cluttering the global namespace).
  • should play well with IDEs (e.g. test code should pass static analysis).

Goals

The Jasmine framework is written with the objective of meeting these goals.<ref>https://github.com/pivotal/jasmine/wiki/Background</ref>

  • it should encourage good testing practices.
  • it should integrate easily with continuous build systems.
  • it should be simple to get started with.

Usage

Behavior Driven Design

Drawbacks

References

<references/>