Skip to content

test.extend triggers various rules from all config #686

@gtbuchanan

Description

@gtbuchanan

Calling test.extend and using the resulting test context results in unexpected warnings for the following rules:

  • require-top-level-describe
  • require-hook
  • no-standalone-expect
import { describe, test } from 'vitest';

interface Context { value: boolean }

const it = test.extend<Context>({ value: true }); // Triggers `require-top-level-describe`

describe.concurrent('extends', () => {
  it('should not trigger lint rules', ({ expect, value }) => { // Triggers `require-hook`
    expect(value).toBe(true); // Triggers `no-standalone-expect`
  });
});

Reproduction: vitest-extend-eslint-bugs.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions