Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} from "@times-components/jest-serializer";
const styles = [
"borderBottomColor",
"borderBottomWidth",
"borderStyle",
"paddingBottom",
"paddingLeft",
"paddingRight",
"paddingTop",
"width"
];
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
stylePrinter,
minimalWebTransform,
flattenStyleTransform,
rnwTransform(AppRegistry, styles)
)
);
// eslint-disable-next-line global-require
require("jest-styled-components");
"fontFamily",
"fontSize",
"fontWeight",
"height",
"justifyContent",
"lineHeight",
"marginBottom",
"marginTop"
];
jest.mock("@times-components/card", () => "Card");
jest.mock("@times-components/link", () => "Link");
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
stylePrinter,
minimalWebTransform,
minimaliseTransform((value, key) => key !== "style" && key !== "className"),
rnwTransform(AppRegistry, styles),
hoistStyleTransform
)
);
// eslint-disable-next-line global-require
require("jest-styled-components");
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
print,
replaceTransform({
svg: propsNoChildren
}),
minimaliseTransform((value, key) => key === "style" || key === "viewBox"),
replacePropTransform(
(value, key) =>
longKeysSet.has(key) ? hash(JSON.stringify(value)) : value
)
)
);
shared(mount);
};
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
print,
minimalWebTransform,
minimaliseTransform((value, key) => omitProps.has(key))
)
);
shared(TestRenderer.create);
};
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
print,
minimalNativeTransform,
flattenStyleTransform
)
);
shared();
};
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
stylePrinter,
flattenStyleTransform,
hoistStyleTransform,
minimalWebTransform,
rnwTransform(AppRegistry)
)
);
shared(mount);
};
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
stylePrinter,
rnwTransform(AppRegistry),
minimalWebTransform,
minimaliseTransform(
(value, key) => key === "style" || key === "className"
)
)
);
iterator(shared());
};
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
print,
minimalNativeTransform,
minimaliseTransform(
(value, key) =>
key === "style" ||
key === "nativeBackgroundAndroid" ||
key.includes("Class")
),
replacePropTransform((value, key) => {
if (key === "uri") {
return hash(value);
}
if (key === "source" && value.uri) {
return hash(value.uri);
}
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
print,
replaceTransform({
svg: justChildren
}),
minimaliseTransform((value, key) => key !== "fill" && key !== "stroke"),
replacePropTransform(
(value, key) =>
longKeysSet.has(key) ? hash(JSON.stringify(value)) : value
)
)
);
shared(mount);
};
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
minimalise((value, key) => omitProps.has(key))
);
const realIntl = Intl;
beforeEach(() => {
global.Intl = {
DateTimeFormat: () => ({
resolvedOptions: () => ({ timeZone: "Europe/London" })
})
};
});
afterEach(() => {
global.Intl = realIntl;
jest.restoreAllMocks();