Skip to content

suggestion: prefer test or it #12

@dylang

Description

@dylang

Suggest using test or it (always-test-or-it)

For consistency in code, always use test or always use it.

Rule details

When test is preferred, this rule triggers a warning for any instances of it.
When it is preferred, this rule triggers a warning for any instances of test.

This rule is not set by default.

Default configuration

The following pattern is considered warning:

it('example 1', () => {
   expect(files).toHaveLength(1);
});

test('example 2', () => {
   expect(files).toHaveLength(1);
});

The following pattern is not warning when test is set:

test('example 1', () => {
   expect(files).toHaveLength(1);
});

test('example 2', () => {
   expect(files).toHaveLength(1);
});

The following pattern is not warning when it is set:

it('example 1', () => {
   expect(files).toHaveLength(1);
});

it('example 2', () => {
   expect(files).toHaveLength(1);
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions