Skip to content
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.
/ jessie Public archive

Node runner for Jasmine JavaScript BDD testing framework

License

Notifications You must be signed in to change notification settings

zendeskarchive/jessie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jessie - a Node runner for Jasmine

Jessie is a Node runner for Jasmine. It was created to provide better reporting on failures, more modular design, easier creation of formatters and optional syntactic sugar.

Installation

Stable version is available on npm, so you can install by using:

npm install jessie

If you want to install the edge development version, simply clone this repo and install from it:

git clone git://github.com/futuresimple/jessie.git
npm install ./jessie

Usage

$ jessie
Usage:
  jessie [OPTIONS] [spec dirs/files]

Options:
  -f, --format [STRING]  Output format to use (Default is progress)
  -v, --version          Display the current version
  -h, --help             Display help and usage details

Jessie will run specs in any folder you specify, but it will automatically load up ‘spec/spec_helper.js’ if it is present.

For details on how to use Jasmine, consult the Jasmine docs at github.com/pivotal/jasmine/wiki

Formatters

Currently Jessie ships with 3 formatters: progress, nested and xunit. By default it uses progress. If you want to use a different one, you can do it by specifying the -f option:

jessie -f [formatter_name] spec
  • Special note on xunit:

Since this formatter is more useful when in a Continuous Integration environment, sending its output to an XML file would be the most common thing to do. Given that Jessie creates separate processes to execute the tests, simply sending the output to a file like “jessie -f xunit spec > test_results.xml” wouldn’t work most of the times. So the following does the trick:

jessie -f xunit spec | cat > test_results.xml

Pending specs

Jessie extends Jasmine with the ability of marking pending specs. You have 2 options - one is to call it with only the description, like this:

it("should be pending")

Another way is to call the pending() function within your spec, like this:

it("should be pending", function() {
  pending()
})

Optionally, you can provide a message that will appear within spec results, simply by sending an argument to pending(), like this:

it("should be pending", function() {
  pending("Add real spec here!")
})

Sugar

If you want, Jessie can extend the built-in prototypes with syntactic sugar, so you can use methods like this:

variable.should_be("Foo Boo")
variable.should_not_be(4)
variable.should_match("Boo")
variable.should_be_a(String)

The number of these methods is limited and will possibly grow with time.

To use them, put this line into spec/spec_helper.js

require('jessie').sugar()

CoffeeScript

Jessie supports CoffeeScript out of the box. All you need to do is add this line to spec/spec_helper.js

require('coffee-script')

With that set set up, you can test your CoffeeScript code and have specs in CoffeeScript.

Continuous test runner

If you want to have your specs run continuously, see Jezebel.

Usage with grunt

If you use grunt, there’s a plugin for it, called grunt-jessie by Kenneth Jørgensen.

Development

Jessie is a fresh project, so forks are very welcome!

Testing

Tests are in Jasmine and run on Jessie. In order to run them, use the binary in the bin folder (be sure to run ‘npm install` first to get the dependencies)

bin/jessie spec

Acknowledgement

jessie is largely based on github.com/mhevery/jasmine-node. The goal of jessie is to be more modular and configurable.

Copyright © 2011 Marcin Bunsch, Future Simple Inc. See LICENSE for details.

About

Node runner for Jasmine JavaScript BDD testing framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published