Permalink
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (51 sloc) 1.16 KB

Enforce new line between declarations inside a suite

Jasmine uses describe to begin and name a test suite. For readability purposes this rule enforces that there is a new line between declarations within a suite. Declarations are it, describe, beforeEach, afterEach, beforeAll, afterAll

Rule details

This rule triggers a warning (is set to 1 by default) whenever it encounters declarations not separated by a new line.

The following patterns are considered warnings:

describe("", function() {
  it("", function(){});
  it("", function(){});
});
describe("", function() {
  beforeEach("", function(){});
  it("", function(){});
});
describe("", function() {
  describe("", function() {});
  describe("", function() {});
});

The following patterns are not warnings:

describe("", function() {
  describe("", function(){});
});
describe("", function() {
  it("", function(){});

  it("", function(){});
});
describe("", function() {
  it("", function(){});
});
describe("", function() {});
describe("", function() {
  var a = 1;
  beforeEach(() => {})

  it("", function(){});
});