babel-plugin-tester
Version:
Utilities for testing babel plugins
39 lines • 1.67 kB
TypeScript
import type { PluginTesterOptions } from "./types.js";
export { prettierFormatter } from "./formatters/prettier.js";
export { unstringSnapshotSerializer } from "./serializers/unstring-snapshot.js";
export { pluginTester, restartTestTitleNumbering, runPluginUnderTestHere, runPresetUnderTestHere, validEndOfLineValues, validTitleNumberingValues };
export type * from "./types.js";
/**
* A unique symbol that, when included in `babelOptions.plugins`, will be
* replaced with the plugin under test. Use this symbol to create a custom
* plugin run order.
*
* @see https://npm.im/babel-plugin-tester#custom-plugin-and-preset-run-order
*/
declare const runPluginUnderTestHere: unique symbol;
/**
* A unique symbol that, when included in `babelOptions.presets`, will be
* replaced with the preset under test. Use this symbol to create a custom
* preset run order.
*
* @see https://npm.im/babel-plugin-tester#custom-plugin-and-preset-run-order
*/
declare const runPresetUnderTestHere: unique symbol;
/**
* Valid choices for the `titleNumbering` babel-plugin-tester option.
*/
declare const validTitleNumberingValues: readonly ["all", "tests-only", "fixtures-only", false];
/**
* Valid choices for the `endOfLine` babel-plugin-tester option.
*/
declare const validEndOfLineValues: readonly ["lf", "crlf", "auto", "preserve", false];
/**
* This function has the same effect as calling `pluginTester` with
* `restartTitleNumbering: true`.
*/
declare function restartTestTitleNumbering(): void;
/**
* An abstraction around babel to help you write tests for your babel plugin or
* preset.
*/
declare function pluginTester(options?: PluginTesterOptions): void;