import { ParseNodeType } from "@zzzen/pyright-internal/dist/parser/parseNodes"; import { TokenType } from "@zzzen/pyright-internal/dist/parser/tokenizerTypes"; import { RuleModule } from "../rule"; import { Program } from "@zzzen/pyright-internal/dist/analyzer/program"; declare type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; } : T; export interface RunTests> { readonly valid: readonly (ValidTestCase | string)[]; readonly invalid: readonly InvalidTestCase[]; } export interface ValidTestCase> { /** * Name for the test case. * @since 8.1.0 */ readonly name?: string; /** * Code for the test case. */ readonly code: string; /** * Environments for the test case. */ readonly env?: Readonly>; /** * The fake filename for the test case. Useful for rules that make assertion about filenames. */ readonly filename?: string; /** * The additional global variables. */ readonly globals?: Record; /** * Options for the test case. */ readonly options?: Readonly>; /** * Run this case exclusively for debugging in supported test frameworks. * @since 7.29.0 */ readonly only?: boolean; } export interface SuggestionOutput { /** * Reported message ID. */ readonly messageId: TMessageIds; /** * The data used to fill the message template. */ readonly data?: Readonly>; /** * NOTE: Suggestions will be applied as a stand-alone change, without triggering multi-pass fixes. * Each individual error has its own suggestion, so you have to show the correct, _isolated_ output for each suggestion. */ readonly output: string; } export interface InvalidTestCase> extends ValidTestCase { /** * Expected errors. */ readonly errors: readonly TestCaseError[]; /** * The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested. */ readonly output?: string | null; } export interface TestCaseError { /** * The 1-based column number of the reported start location. */ readonly column?: number; /** * The data used to fill the message template. */ readonly data?: Readonly>; /** * The 1-based column number of the reported end location. */ readonly endColumn?: number; /** * The 1-based line number of the reported end location. */ readonly endLine?: number; /** * The 1-based line number of the reported start location. */ readonly line?: number; /** * Reported message ID. */ readonly messageId: TMessageIds; /** * Reported suggestions. */ readonly suggestions?: readonly SuggestionOutput[] | null; /** * The type of the reported AST node. */ readonly type?: ParseNodeType | TokenType; } export declare function runRuleTest>(name: string, rule: RuleModule, testsReadonly: RunTests): void; export declare const libraryRoot: string; export declare const fallbackPath: string; export declare function createProgramWithFile(content: string): Program; export {}; //# sourceMappingURL=ruleTest.d.ts.map