@airbnb/config-jest
Version:
Reusable Jest config.
23 lines (16 loc) • 506 B
JavaScript
/* eslint-disable no-param-reassign */
exports.test = function test(value) {
return value && !value.withStyles && value.$$typeof === Symbol.for('react.test.json');
};
exports.print = function print(value, printer) {
value.withStyles = true;
if (value.props.theme) {
delete value.props.theme;
delete value.props.themeName;
}
if (value.props.styles) {
value.props.withStylesClasses = Object.keys(value.props.styles);
delete value.props.styles;
}
return printer(value);
};