How to use the corvid-local-test-utils.siteCreators.matchItem function in corvid-local-test-utils

To help you get started, we’ve selected a few corvid-local-test-utils 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 wix-incubator / corvid / packages / corvid-local-site / src / testkit / localSiteBuilder.js View on Github external
const getLocalPageRootPath = pageOrLightboxItem =>
  sc.matchItem(pageOrLightboxItem, {
    [sc.page]: pageRootPath,
    [sc.pageWithCode]: ({ page }) => pageRootPath(page),
    [sc.lightbox]: lightboxRootPath,
    [sc.lightboxWithCode]: ({ lightbox }) => lightboxRootPath(lightbox)
  });
github wix-incubator / corvid / packages / corvid-local-site / src / testkit / localSiteBuilder.js View on Github external
const itemToFile = item =>
  sc.matchItem(item, {
    [sc.page]: page,
    [sc.pageWithCode]: pageWithCode,
    [sc.lightbox]: lightbox,
    [sc.lightboxWithCode]: lightboxWithCode,
    [sc.router]: router,
    [sc.menu]: menu,
    [sc.colors]: colors,
    [sc.fonts]: fonts,
    [sc.theme]: theme,
    [sc.topLevelStyles]: topLevelStyles,
    [sc.commonComponents]: commonComponents,
    [sc.multilingualInfo]: multilingualInfo,
    [sc.siteInfo]: siteInfo,
    [sc.version]: version,
    [sc.publicCode]: publicCodeFile,
    [sc.backendCode]: backendCodeFile,
github wix-incubator / corvid / packages / corvid-local-site / src / testkit / localSiteBuilder.js View on Github external
const getLocalFilePath = (siteItem, partKey) => {
  const file = itemToFile(siteItem);
  const pickValue = paths => (isUndefined_(partKey) ? paths : paths[partKey]);
  return sc.matchItem(siteItem, {
    [sc.page]: () =>
      pickValue({
        page: file[0].path,
        code: file[1].path,
        tsConfig: file[2].path,
        typings: file[3].path
      }),
    [sc.pageWithCode]: () =>
      pickValue({
        page: file[0].path,
        code: file[1].path,
        tsConfig: file[2].path,
        typings: file[3].path
      }),
    [sc.lightbox]: () =>
      pickValue({
github wix-incubator / corvid / packages / corvid-fake-local-mode-editor / src / editorSiteBuilder.js View on Github external
...siteItems.map(item =>
      sc.matchItem(item, {
        [sc.page]: page,
        [sc.pageWithCode]: pageWithCode,
        [sc.lightbox]: lightbox,
        [sc.lightboxWithCode]: lightboxWithCode,
        [sc.router]: router,
        [sc.menu]: menu,
        [sc.colors]: colors,
        [sc.fonts]: fonts,
        [sc.theme]: theme,
        [sc.topLevelStyles]: topLevelStyles,
        [sc.commonComponents]: commonComponents,
        [sc.multilingualInfo]: multilingualInfo,
        [sc.siteInfo]: siteInfo,
        [sc.version]: version,
        [sc.publicCode]: publicCodeFile,
        [sc.backendCode]: backendCodeFile,