Skip to content

jasmine-set brings rspec's let syntax to the Jasmine BDD Javascript testing framework.

Notifications You must be signed in to change notification settings

farias-r7/jasmine-set

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

jasmine-set brings rspec's let syntax to the Jasmine behavior-driven development framework for testing JavaScript code. The set global function is provided, which allows the spec writer to define lazy global accessors that can be refined in nested specs. To achieve this behavior, the Suite.prototype.finish function from Jasmine is wrapped.

Why not let?

In Ecmascript, let is a reserved word that allows for block-level scoping (as opposed to var, which is functionally-scoped).

Sample Usage

describe 'House', ->
  set 'opts',  -> {}
  set 'house', -> new House(opts)

  it 'has a door', -> expect(house).toHaveADoor()

  describe 'with no doors', ->
    set 'opts', -> { doors: 0 }

    it 'does not have a door', -> expect(house).not.toHaveADoor()

Dependencies

  • underscore (~1.6)
  • node >= 0.8

Building from source

$ npm i
$ grunt build

Running specs

$ grunt test

License

MIT

Copyright

Rapid7 2014

About

jasmine-set brings rspec's let syntax to the Jasmine BDD Javascript testing framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CoffeeScript 63.4%
  • JavaScript 36.6%