Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Jessie - TDD in node.js using Jasmine

on

  • 9,454 views

Jessie is a node.js runner for Jasmine BDD framework.

Jessie is a node.js runner for Jasmine BDD framework.

It allows running of Jasmine specs in node.js environment, adds pending specs, improves error and failure reporting.

Statistics

Views

Total Views
9,454
Views on SlideShare
9,340
Embed Views
114

Actions

Likes
7
Downloads
63
Comments
0

4 Embeds 114

http://fernando.blat.es 71
http://paper.li 41
http://twitter.com 1
http://webcache.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

    Jessie - TDD in node.js using Jasmine Jessie - TDD in node.js using Jasmine Presentation Transcript

    • jessie TDD in node.js using Jasmine Marcin Bunsch nodecamp.eu 2011Sunday, June 12, 2011
    • Jasmine • JavaScript testing framework • does not depend on any other JavaScript frameworks. • does not require a DOM. • does not pollute prototypes • similar to RSpecSunday, June 12, 2011
    • Jasmine - suites and specs describe(Simple specs, function() { it("should work", function() { expect("aaa").toEqual(aaa) }) it("should work with not", function() { expect("bbb").not.toEqual(aaa) }) })Sunday, June 12, 2011
    • Jasmine - matchers expect(x).toEqual(y) expect(x).toBe(y) expect(x).toMatch(pattern) expect(x).toBeDefined() expect(x).toBeNull() expect(x).toBeTruthy() expect(x).toBeFalsy() expect(x).toContain(y) expect(x).toBeLessThan(y) expect(x).toBeGreaterThan(y) expect(fn).toThrow(e)Sunday, June 12, 2011
    • Jasmine - before and after describe(Before and after specs, function() { var a = 1 beforeEach(function() { a += 1 }) afterEach(function() { a += 1 }) it("should execute the beforeEach", function() { expect(a).toEqual(2) }) it("should execute the afterEach", function() { expect(a).toEqual(4) }) })Sunday, June 12, 2011
    • Jasmine - spies describe(Spies, function() { var some_object = { some_func: function() {} } it("should be able to spy on existing objects", function() { spyOn(some_object, some_func) some_object.some_func() expect(some_object.some_func).toHaveBeenCalled() }) it("should be able to create spies", function() { var spy_func = jasmine.createSpy() spy_func() expect(spy_func).toHaveBeenCalled() }) })Sunday, June 12, 2011
    • Jessie • node.js runner for Jasmine • extends Jasmine • introduces pending specs • improves error and failure reporting • multiple report formatters • supports CoffeeScriptSunday, June 12, 2011
    • Jessie - pending specs describe(Pending specs, function() { it("should work") it("should work with pending", function() { pending("TODO") }) })Sunday, June 12, 2011
    • Jessie - failure reporting describe(Failing spec, function() { it("should fail", function() { expect(1).toEqual(2) }) })Sunday, June 12, 2011
    • Jessie - formattersSunday, June 12, 2011
    • Jessie - formattersSunday, June 12, 2011
    • Jessie - sugar describe(Sugar specs, function() { var number = 1 var array = [1,2] var func = function() {} it("should work", function() { "aaa".should_be("aaa") number.should_be(1) array.should_be([1,2]) func.should_be_a(Function) "bike courier".should_match("bike") }) it("should work with not", function() { "bbb".should_not_be("aaa") number.should_not_be(2) array.should_not_be([3,4]) }) })Sunday, June 12, 2011
    • Jessie - CoffeeScript describe OMG Coffee Spec, -> it "should work", -> expect(1).toEqual 1 it "should work", -> "foo".should_be "foo"Sunday, June 12, 2011
    • github.com/futuresimple/jessieSunday, June 12, 2011