babel-plugin-tester
Version:
Utilities for testing babel plugins
26 lines (25 loc) • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.pluginTester = defaultPluginTester;
var _constant = require("./constant.js");
var _prettier = require("./formatters/prettier.js");
exports.prettierFormatter = _prettier.prettierFormatter;
var _pluginTester = require("./plugin-tester.js");
exports.runPluginUnderTestHere = _pluginTester.runPluginUnderTestHere;
exports.runPresetUnderTestHere = _pluginTester.runPresetUnderTestHere;
var _unstringSnapshot = require("./serializers/unstring-snapshot.js");
exports.unstringSnapshotSerializer = _unstringSnapshot.unstringSnapshotSerializer;
if ('expect' in globalThis && typeof expect.addSnapshotSerializer === 'function') {
_constant.globalDebugger.message('added unstring snapshot serializer globally; all snapshots after this point will be affected');
expect.addSnapshotSerializer(_unstringSnapshot.unstringSnapshotSerializer);
} else {
_constant.globalDebugger.warn('unable to add unstring snapshot serializer: global expect object is missing or unsupported');
}
function defaultPluginTester(options) {
(0, _pluginTester.pluginTester)({
formatResult: _prettier.prettierFormatter,
...options
});
}