Skip to content

Commit

Permalink
chore(valid-title): update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Oct 27, 2019
1 parent 97c500a commit a24e190
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 38 deletions.
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -117,7 +117,6 @@ installations requiring long-term consistency.
| [no-commented-out-tests][] | Disallow commented out tests | | |
| [no-disabled-tests][] | Disallow disabled tests | ![recommended][] | |
| [no-duplicate-hooks][] | Disallow duplicate hooks within a `describe` block | | |
| [no-empty-title][] | Disallow empty titles | | |
| [no-expect-resolves][] | Disallow using `expect().resolves` | | |
| [no-export][] | Disallow export from test files | | |
| [no-focused-tests][] | Disallow focused tests | ![recommended][] | |
Expand Down Expand Up @@ -173,7 +172,6 @@ https://github.com/dangreenisrael/eslint-plugin-jest-formatting
[no-commented-out-tests]: docs/rules/no-commented-out-tests.md
[no-disabled-tests]: docs/rules/no-disabled-tests.md
[no-duplicate-hooks]: docs/rules/no-duplicate-hooks.md
[no-empty-title]: docs/rules/no-empty-title.md
[no-expect-resolves]: docs/rules/no-expect-resolves.md
[no-export]: docs/rules/no-export.md
[no-focused-tests]: docs/rules/no-focused-tests.md
Expand Down
36 changes: 0 additions & 36 deletions docs/rules/no-empty-title.md

This file was deleted.

33 changes: 33 additions & 0 deletions docs/rules/valid-title.md
Expand Up @@ -2,11 +2,44 @@

Checks that the title of Jest blocks are valid by ensuring that titles are:

- not empty,
- not prefixed with their block name,
- have no leading or trailing spaces

## Rule Details

**emptyTitle**

An empty title is not informative, and serves little purpose.

Examples of **incorrect** code for this rule:

```js
describe('', () => {});
describe('foo', () => {
it('', () => {});
});
it('', () => {});
test('', () => {});
xdescribe('', () => {});
xit('', () => {});
xtest('', () => {});
```

Examples of **correct** code for this rule:

```js
describe('foo', () => {});
describe('foo', () => {
it('bar', () => {});
});
test('foo', () => {});
it('foo', () => {});
xdescribe('foo', () => {});
xit('foo', () => {});
xtest('foo', () => {});
```

**duplicatePrefix**

A describe/ test block should not start with duplicatePrefix
Expand Down

0 comments on commit a24e190

Please sign in to comment.