jasmine-only
Exclusivity spec helpers for jasmine: `describe.only` and `it.only`
Last updated 10 years ago by searls .
Apache License 2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install jasmine-only 
SYNC missed versions from official npm registry.

jasmine-only

Build Status

jasmine-only is a standalone plugin that you can load after jasmine that adds mocha-style exclusivity helpers describe.only and it.only to jasmine 1.3.1

Download the latest version here.

examples

The exclusivity feature allows you to run only the specified suite or test-case by appending .only() to the call

here is a simple example:

describe "jasmine-only", ->

  describe "describe.only and it.only", ->

    normal    = jasmine.createSpy('normal spec')
    exclusive = jasmine.createSpy('exclusive spec')

    describe "normal", ->
      it "shouldnt execute this 1", normal
      it.only "it only executes this 1", exclusive

    describe.only "exclusive", ->
      it "shouldnt execute this 2", normal
      it.only "it only executes this 2", exclusive

      describe "nested exclusive", ->
        it.only "it only executes this 3", ->
          exclusive()
          expect(normal).not.toHaveBeenCalled()
          expect(exclusive).toHaveBeenCalled()
          expect(exclusive.callCount).toBe(3)

    describe.only "normal 2", ->
      it "shouldnt execute this 3", normal

aliases

jasmine-only has the following aliases for exclusive spec helpers

describe.only can be written as ddescribe

it.only can be written as iit

thanks / prior art

Much of this work is based on existing prior art, thanks to:

Current Tags

  • 0.1.2                                ...           latest (9 years ago)

4 Versions

  • 0.1.2                                ...           9 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
Maintainers (2)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE