Team Alex and Jeremy

A team for American National Red Cross

  • $0
  • 0
  • 0

This campaign already ended. We hope you like the results!

$0 raised of $25,000

"Team Alex and Jeremy" a team to help the American National Red Cross...


name dollars donors

Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests.

This guide is running against Jasmine version 1.3.1 revision 1354556913.

Suites: describe Your Tests

A test suite begins with a call to the global Jasmine function describe with two parameters: a string and a function. The string is a name or title for a spec suite – usually what is under test. The function is a block of code that implements the suite.


Specs are defined by calling the global Jasmine function it, which, like describetakes a string and a function. The string is a title for this spec and the function is the spec, or test. A spec contains one or more expectations that test the state of the code under test.

An expectation in Jasmine is an assertion that can be either true or false. A spec with all true expectations is a passing spec. A spec with one or more expectations that evaluate to false is a failing spec.

describe("A suite", function() {
  it("contains spec with an expectation", function() {

It’s Just Functions

Since describe and it blocks are functions, they can contain any executable code necessary to implement the test. JavaScript scoping rules apply, so variables declared in a describe are available to any it block inside the suite.

describe("A suite is just a function", function() {
  var a;

  it("and so is a spec", function() {
    a = true;



Expectations are built with the function expect which takes a value, called the actual. It is chained with a Matcher function, which takes the expected value.

describe("The 'toBe' matcher compares with ===", function() {


Each matcher implements a boolean comparison between the actual value and the expected value. It is responsible for reporting to Jasmine if the expectation is true or false. Jasmine will then pass or fail the spec.

  it("and has a positive case ", function() {

Team Captain

Jeremy Burton Jeremy Burton

I want to enable anyone to change the world