Adds a done-friendly beforeAll setup to jasmine
Want to see pretty graphs? Log in now!
npm install jasmine-before-all
|80||downloads in the last day|
|187||downloads in the last week|
|541||downloads in the last month|
|Last Published By|
|Version||0.1.0 last updated 4 months ago|
|License||Apache License 2.0|
jasmine-before-all is a standalone plugin that you can load after jasmine that adds global
afterAll functions that call
afterEach, respectively, at most one time per callback definition.
Importantly, they play nicely with
done mechanisms like those found in minijasminenode.
afterAll is typically a bad idea for unit tests, but if you're using Jasmine for integration tests, it'll probably come in handy as soon as your setup becomes expensive.
Does what it says on the tin. This would pass, for instance:
describe 'intentional pollution', -> foo = 0 beforeAll -> foo += 1 context '1', -> Then -> foo == 1 context '2', -> Then -> foo == 1 context '3', -> Then -> foo == 1 afterAll -> foo++; expect(foo).toEqual(2)
And if your test runner includes a "done" callback (or you've included one as a helper), this should also work:
describe '(asynchronous) intentional pollution', -> bar = 3 beforeAll (done) -> setTimeout -> bar -= 1 done() , 100 context '1', -> Then -> bar == 2 context '2', -> Then -> bar == 2 context '3', -> Then -> bar == 2