How to use @times-components/jest-serializer - 10 common examples

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 / author-profile / __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");

  const props = {
    analyticsStream() {},
github newsuk / times-components / packages / styleguide / __tests__ / web / serializers.js View on Github external
const { AppRegistry } = require("react-native-web");
const {
  addSerializers,
  compose,
  minimalWebTransform,
  print,
  rnwTransform
} = require("@times-components/jest-serializer");

addSerializers(
  expect,
  compose(
    print,
    minimalWebTransform,
    rnwTransform(AppRegistry)
  )
);

// eslint-disable-next-line global-require
require("jest-styled-components");
github newsuk / times-components / packages / article-main-standard / __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");

  beforeEach(() => {
    const nuk = {
      user: {
        isLoggedIn: true
      }
    };
    global.nuk = nuk;
  });

  afterEach(() => {
github newsuk / times-components / packages / article-skeleton / __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");

  beforeEach(() => {
    const nuk = {
      user: {
        isLoggedIn: true
      }
    };
    global.nuk = nuk;
  });

  afterEach(() => {
github newsuk / times-components / packages / article-in-depth / __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");

  beforeEach(() => {
    const nuk = {
      user: {
        isLoggedIn: true
      }
    };
    global.nuk = nuk;
  });

  afterEach(() => {
github newsuk / times-components / packages / related-articles / __tests__ / shared-with-style.web.js View on Github external
"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");
github newsuk / times-components / packages / article-paragraph / __tests__ / shared-with-style.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeRenderedSerializer(),
    compose(
      stylePrinter,
      rnwTransform(AppRegistry),
      minimalWebTransform,
      minimaliseTransform(
        (value, key) => key !== "style" && key !== "className"
      )
    )
  );

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

  iterator([
    {
      name: "mpu config",
      test: () => {
        expect(
          TestRenderer.create(renderParagraph(dropCapData))
github newsuk / times-components / packages / slice-layout / __tests__ / serializers-with-style.web.js View on Github external
} 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");