{"size": 3706, "ext": "js", "max_stars_repo_path": "__mocks__/helpers/strapi.js", "max_stars_repo_name": "voytech-net/strapi-plugin-navigation", "max_stars_repo_stars_event_min_datetime": "2021-05-12T18:40:43.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T12:04:24.000Z", "max_issues_repo_path": "__mocks__/helpers/strapi.js", "max_issues_repo_name": "voytech-net/strapi-plugin-navigation", "max_issues_repo_issues_event_min_datetime": "2021-05-07T06:03:14.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T22:46:07.000Z", "max_forks_repo_path": "__mocks__/helpers/strapi.js", "max_forks_repo_name": "voytech-net/strapi-plugin-navigation", "max_forks_repo_forks_event_min_datetime": "2021-05-14T23:04:49.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-27T13:14:18.000Z"}
{"max_stars_count": 126, "max_issues_count": 106, "max_forks_count": 22, "avg_line_length": 36.3333333333, "max_line_length": 94, "alphanum_fraction": 0.3931462493}
const {get} = require('lodash');
function setupStrapi() {
    Object.defineProperty(global, 'strapi', {
        value: {
          query: jest.fn().mockImplementation(() => ({
              count: jest.fn().mockImplementation(),
          })),
          config: {
              custom: {
                  plugins: {
                      navigation: {
                          contentTypesNameFields: {
                              'blog_posts': ['altTitle'],
                          },
                      },
                  },
              },
            get(path, defaultValue) {
              return get(strapi, path, defaultValue);
            },
          },
          api: {
              'home-page': {
                  config: {
                      routes: [
                        {
                          method: 'GET',
                          path: '/custom-api',
                          handler: 'home-page.find',
                        },
                        {
                          method: 'PUT',
                          path: '/custom-api',
                          handler: 'home-page.update',
                        },
                      ]
                  }
              }
          },
          contentTypes: {
            'pages': {
                ...require('./pages.settings.json'),
                apiName: 'pages',
                modelName: 'pages',
                associations: [{ model: 'navigationitem' }],
            },
            'application::blog-post.blog-post': {
                ...require('./blog-post.settings.json'),
                apiName: 'blog-posts',
                modelName: 'blog-posts',
                associations: [{ model: 'navigationitem' }],
            },
            'application::my-homepages.my-homepage': {
                ...require('./my-homepage.settings.json'),
                apiName: 'my-homepage',
                modelName: 'my-homepage',
                associations: [{ model: 'navigationitem' }],
            },
            'application::page-homes.home-page': {
                ...require('./home-page.settings.json'),
                apiName: 'custom-api',
                modelName: 'home-page',
                associations: [{ model: 'navigationitem' }],
            },
            'plugins::another-plugin.pages': {
                ...require('./another-plugin/pages.settings.json'),
                modelName: 'plugin-pages',
                associations: [{ model: 'navigationitem' }],
            },
            'plugins::another-plugin.blog-post': {
                ...require('./another-plugin/blog-post.settings.json'),
                modelName: 'plugin-blog-posts',
                associations: [{ model: 'navigationitem' }],
            }
          },
          plugins: {
              navigation: {
                  services: {
                      navigation: jest.fn().mockImplementation(),
                  },
                relatedContentTypes: [
                  'application::pages.pages',
                  'application::blog-post.blog-post',
                  'application::my-homepages.my-homepage',
                  'application::page-homes.home-page',
                  'plugins::another-plugin.pages',
                  'plugins::another-plugin.blog-post'
                ]
              },
              anotherPlugin: {
                  models: {
                      'plugin-pages': require('./another-plugin/pages.settings.json'),
                      'plugin-blog-post': require('./another-plugin/blog-post.settings.json'),
                  }
              }
          },
      },
      writable: true,
    })
}
module.exports = { setupStrapi };
