How to use the @times-components/jest-serializer.addSerializers function in @times-components/jest-serializer

To help you get started, we’ve selected a few @times-components/jest-serializer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newsuk / times-components / packages / topic / __tests__ / shared-with-style.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      stylePrinter,
      minimalWebTransform,
      minimaliseTransform(
        (value, key) => key !== "style" && key !== "className"
      ),
      flattenStyleTransform,
      hoistStyleTransform,
      rnwTransform(AppRegistry, styles)
    )
  );

  // eslint-disable-next-line global-require
  require("jest-styled-components");
github newsuk / times-components / packages / image / __tests__ / shared.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalWebTransform,
      minimaliseTransform(
        (value, key) => key === "style" || key === "className"
      ),
      replacePropTransform((value, key) => (key === "d" ? hash(value) : value))
    )
  );

  // eslint-disable-next-line global-require
  require("jest-styled-components");

  const tests = [
    {
github newsuk / times-components / packages / ad / __tests__ / ad.shared.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeRootSerializer(),
    compose(
      print,
      minimaliseTransform((value, key) => key === "style" || key === "value")
    )
  );

  it("advert", () => {
    const wrapper = shallow(
      
        
          
        
      
    );
github newsuk / times-components / packages / article / __tests__ / shared.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform((value, key) => omitKeys.has(key))
    )
  );

  const tests = [
    {
      name: "an inline link uses the given onPress",
      test() {
        const onLinkPress = jest.fn();

        const testInstance = TestRenderer.create(
github newsuk / times-components / packages / article-magazine-standard / __tests__ / shared-tablet.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform((value, key) => key !== "style"),
      flattenStyleTransform
    )
  );

  const tests = [
    {
      name: "Article Magazine Standard - Tablet",
      test() {
        setIsTablet(true);

        const testInstance = TestRenderer.create(
github newsuk / times-components / packages / article-byline / __tests__ / shared-with-styles.web.js View on Github external
export default Component => {
  addSerializers(
    expect,
    compose(
      stylePrinter,
      hoistStyleTransform,
      minimalWebTransform,
      rnwTransform(AppRegistry, [
        "fontSize",
        "fontFamily",
        "color",
        "lineHeight",
        "flexDirection"
      ])
    )
  );

  shared(Component);
github newsuk / times-components / packages / markup / __tests__ / shared-ad.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeTreeSerializer(),
    compose(
      stylePrinter,
      flattenStyleTransform,
      replaceTransform({
        Ad: propsNoChildren,
        AdComposer: justChildren,
        Broadcast: justChildren,
        ...meltNative
      }),
      rnwTransform()
    )
  );

  shared(component => mount({component}));
github newsuk / times-components / packages / home-page / __tests__ / shared.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform((value, key) => key === "style" || key === "testID")
    )
  );

  shared();
};
github newsuk / times-components / packages / caption / __tests__ / shared.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      stylePrinter,
      minimalWebTransform,
      rnwTransform(AppRegistry)
    )
  );

  shared();
};
github newsuk / times-components / packages / article-skeleton / __tests__ / shared.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform((value, key) => omitKeys.has(key))
    )
  );

  beforeEach(() => {
    mockDate.set(1514764800000, 0);
  });

  afterEach(() => {
    mockDate.reset();
  });