Make sure that all uses of the global beforeEach
, afterEach
, beforeAll
, and afterAll
methods are within a suite.
The only appropriate use of these methods in a global context is within jasmine helpers where the intent of the global definition is explicit (e.g. setting up globally applied matchers). See example: /jasmine/jasmine/lib/jasmine-core/example/node_example/spec/helpers/jasmine_examples/SpecHelper.js
The following are considered warnings:
beforeEach(function() { /* ... */ })
afterEach(function() { /* ... */ })
The following patterns are not warnings:
describe(function() {
beforeEach(function() { /* ... */ })
})