Skip to content

⬅️ Back to Table of Contents

📄 ValidTestCase

📊 Analysis Summary

Metric Count
📦 Imports 5
📐 Interfaces 2

📚 Table of Contents

🛠️ File Location:

📂 packages/rule-tester/src/types/ValidTestCase.ts

📦 Imports

Name Source
Linter @typescript-eslint/utils/ts-eslint
Parser @typescript-eslint/utils/ts-eslint
ParserOptions @typescript-eslint/utils/ts-eslint
SharedConfigurationSettings @typescript-eslint/utils/ts-eslint
DependencyConstraint ./DependencyConstraint

Interfaces

TestLanguageOptions

Interface Code
export interface TestLanguageOptions {
  /**
   * Environments for the test case.
   */
  readonly env?: Readonly<Linter.EnvironmentConfig>;
  /**
   * The additional global variables.
   */
  readonly globals?: Readonly<Linter.GlobalsConfig>;
  /**
   * The absolute path for the parser.
   */
  readonly parser?: Readonly<Parser.LooseParserModule>;
  /**
   * Options for the parser.
   */
  readonly parserOptions?: Readonly<ParserOptions>;
}

Properties

Name Type Optional Description
env Readonly<Linter.EnvironmentConfig> not shown
globals Readonly<Linter.GlobalsConfig> not shown
parser Readonly<Parser.LooseParserModule> not shown
parserOptions Readonly<ParserOptions> not shown

ValidTestCase<Options extends readonly unknown[]>

Interface Code
export interface ValidTestCase<Options extends readonly unknown[]> {
  /**
   * Function to execute after testing the case regardless of its result.
   */
  readonly after?: () => void;
  /**
   * Function to execute before testing the case.
   */
  readonly before?: () => void;
  /**
   * Code for the test case.
   */
  readonly code: string;
  /**
   * Constraints that must pass in the current environment for the test to run
   */
  readonly dependencyConstraints?: DependencyConstraint;
  /**
   * The fake filename for the test case. Useful for rules that make assertion about filenames.
   */
  readonly filename?: string;
  /**
   * Language options for the test case.
   */
  readonly languageOptions?: TestLanguageOptions;
  /**
   * Name for the test case.
   */
  readonly name?: string;
  /**
   * Run this case exclusively for debugging in supported test frameworks.
   */
  readonly only?: boolean;
  /**
   * Options for the test case.
   */
  readonly options?: Readonly<Options>;
  /**
   * Settings for the test case.
   */
  readonly settings?: Readonly<SharedConfigurationSettings>;
  /**
   * Skip this case in supported test frameworks.
   */
  readonly skip?: boolean;
}

Properties

Name Type Optional Description
after () => void not shown
before () => void not shown
code string not shown
dependencyConstraints DependencyConstraint not shown
filename string not shown
languageOptions TestLanguageOptions not shown
name string not shown
only boolean not shown
options Readonly<Options> not shown
settings Readonly<SharedConfigurationSettings> not shown
skip boolean not shown

Generated by Syntax Scribe