import { SecretLintCoreConfig, SecretLintUnionRuleCreator } from "@secretlint/types"; export type SnapshotOptions = { /** * Snapshot directory * * Example: /{test-case-name}/ */ snapshotDirectory: string | URL; /** * Define default config for testing */ defaultConfig: SecretLintCoreConfig; /** * testDefinitions * Replace `id` to `rule` implicitly * If this options is not defined, create testDefinitions from defaultConfig. * * This options are not required almost case. */ testDefinitions?: { id: string; rule: SecretLintUnionRuleCreator; }[]; /** * Update snapshot if the options is true * Exception, process.env.UPDATE_SNAPSHOT=1 force turn on this option. */ updateSnapshot: boolean; }; /** * Each test case options * * If /options.js, use it */ export type SecretLintTestCaseOptions = { inputFilePath?: string; }; /** * // Mocha * // $ mocha --loader ts-node/esm test/index.test.ts * describe("Snapshot Testing", () => { * snapshot(options).forEach((name, test) => { * it(name, async function() { * const status = await test(); * if(status === "skip"){ * this.skip(); * } * }); * } * }); * // note:test * // $ node --loader ts-node/esm --test test/index.test.ts * import test from "node:test"; * describe("Snapshot Testing", (t) => { * await snapshot(options).forEach((name, test) => { * return t.it(name, async function(context) { * const status = await test(); * if(status === "skip"){ * context.skip(); * } * }); * } * }); */ export declare const snapshot: (options: SnapshotOptions) => { forEach(handler: (testCaseName: string, testFunction: () => Promise<"skip" | "done">) => void): Promise; }; //# sourceMappingURL=index.d.ts.map