|
| 1 | +# Enforce consistent spacing between test blocks (`enforce-consistent-spacing-between-blocks`) |
| 2 | + |
| 3 | +Ensure that there is a consistent spacing between test blocks. |
| 4 | + |
| 5 | +## Rule Details |
| 6 | + |
| 7 | +Examples of **incorrect** code for this rule: |
| 8 | + |
| 9 | +```javascript |
| 10 | +test('example 1', () => { |
| 11 | + expect(true).toBe(true) |
| 12 | +}) |
| 13 | +test('example 2', () => { |
| 14 | + expect(true).toBe(true) |
| 15 | +}) |
| 16 | +``` |
| 17 | + |
| 18 | +```javascript |
| 19 | +test.beforeEach(() => {}) |
| 20 | +test('example 3', () => { |
| 21 | + await test.step('first', async () => { |
| 22 | + expect(true).toBe(true) |
| 23 | + }) |
| 24 | + await test.step('second', async () => { |
| 25 | + expect(true).toBe(true) |
| 26 | + }) |
| 27 | +}) |
| 28 | +``` |
| 29 | + |
| 30 | +Examples of **correct** code for this rule: |
| 31 | + |
| 32 | +```javascript |
| 33 | +test('example 1', () => { |
| 34 | + expect(true).toBe(true) |
| 35 | +}) |
| 36 | + |
| 37 | +test('example 2', () => { |
| 38 | + expect(true).toBe(true) |
| 39 | +}) |
| 40 | +``` |
| 41 | + |
| 42 | +```javascript |
| 43 | +test.beforeEach(() => {}) |
| 44 | + |
| 45 | +test('example 3', () => { |
| 46 | + await test.step('first', async () => { |
| 47 | + expect(true).toBe(true) |
| 48 | + }) |
| 49 | + |
| 50 | + await test.step('second', async () => { |
| 51 | + expect(true).toBe(true) |
| 52 | + }) |
| 53 | +}) |
| 54 | +``` |
0 commit comments