


const ReportGenerator = require('./report/report-generator');

const reportGenerator = new ReportGenerator();

var stub =


  {
    url: 'https://pwa.rocks/',
    aggregations:
    [{
      name: 'App can load on offline/flaky connections',
      shortName: undefined,
      description: 'Ensuring your web app can respond when the network connection is unavailable or flaky is\n            critical to providing your users a good experience. This is achieved through use of a\n            <a href="https://developers.google.com/web/fundamentals/primers/service-worker/">Service Worker</a>.',
      type: { name: 'Progressive Web App', contributesToScore: true },
      score:
      {
        overall: 0,
        subItems:
        [{
          value: false,
          rawValue: undefined,
          debugString: undefined,
          optimalValue: undefined,
          extendedInfo: undefined,
          name: 'service-worker',
          category: 'Offline',
          description: 'Has a registered Service Worker'
        },
          {
            value: false,
            rawValue: undefined,
            debugString: undefined,
            optimalValue: undefined,
            extendedInfo: undefined,
            name: 'works offline',
            category: 'Offline',
            description: 'URL responds with a 200 when offline'
          },
          ]
      }
    },
      {
        name: 'Page load performance is fast',
        shortName: undefined,
        description: 'Users notice if sites and apps don\'t perform well. These top-level metrics capture\n            the most important perceived performance concerns.',
        type: { name: 'Progressive Web App', contributesToScore: true },
        score:
        {
          overall: 0.9933333333333333,
          subItems:
          [{
            value: 100,
            rawValue: '873.17ms',
            debugString: undefined,
            optimalValue: '1,000ms',
            extendedInfo: undefined,
            name: 'first-contentful-paint',
            category: 'Performance',
            description: 'Fast first paint of content'
          },
            {
              value: 98,
              rawValue: 1449,
              debugString: undefined,
              optimalValue: '1,000ms',
              extendedInfo: undefined,
              name: 'speed-index-metric',
              category: 'Performance',
              description: 'Speed Index Metric'
            },
            {
              value: 100,
              rawValue: '0.0000',
              debugString: undefined,
              optimalValue: '100',
              extendedInfo: undefined,
              name: 'input-readiness',
              category: 'Performance',
              description: 'Input Readiness'
            },
            ]
        }
      },
      {
        name: 'Network connection is secure',
        shortName: undefined,
        description: 'Security is an important part of the web for both developers and users. Moving forward,\n            Transport Layer Security (TLS) support will be required for many APIs.',
        type: { name: 'Progressive Web App', contributesToScore: true },
        score:
        {
          overall: 1,
          subItems:
          [{
            value: true,
            rawValue: undefined,
            debugString: undefined,
            optimalValue: undefined,
            extendedInfo: undefined,
            name: 'is-on-https',
            category: 'Security',
            description: 'Site is on HTTPS'
          },
            {
              value: true,
              rawValue: undefined,
              debugString: undefined,
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'redirects-http',
              category: 'Security',
              description: 'Site redirects HTTP traffic to HTTPS'
            },
            ]
        }
      },
      {
        name: 'User can be prompted to Add to Homescreen',
        shortName: undefined,
        description: 'While users can manually add your site to their homescreen in the browser menu, the\n            <a href="https://developers.google.com/web/updates/2015/03/increasing-engagement-with-app-install l-banners -in-chrome -for-android ? hl = en">prompt\n            (aka app install banner)</a> will proactively prompt the user to install the\n            app if the below requirements are met and the user has visited your site at\n            least twice (with at least five minutes between visits).',
       type: { name: 'Progressive Web App', contributesToScore: true },
        score:
        {
          overall: 0.75,
          subItems:
          [{
            value: false,
            rawValue: undefined,
            debugString: undefined,
            optimalValue: undefined,
            extendedInfo: undefined,
            name: 'service-worker',
            category: 'Offline',
            description: 'Has a registered Service Worker'
          },
            {
              value: true,
              rawValue: undefined,
              debugString: undefined,
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-exists',
              category: 'Manifest',
              description: 'Manifest exists'
            },
            {
              value: true,
              rawValue: undefined,
              debugString: undefined,
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-start-url',
              category: 'Manifest',
              description: 'Manifest contains start_url'
            },
            {
              value: true,
              rawValue: undefined,
              debugString: 'Found icons of sizes: 144x144,180x180,192x192,228x228',
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-icons-min-144',
              category: 'Manifest',
              description: 'Manifest contains icons at least 144px'
            },
            {
              value: true,
              rawValue: undefined,
              debugString: undefined,
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-short-name',
              category: 'Manifest',
              description: 'Manifest contains short_name'
            },
            ]
        }
      },
      {
        name: 'Installed web app will launch with custom splash screen',
        shortName: undefined,
        description: 'A default splash screen will be constructed, but meeting these requirements guarantee a\n            high-quality and customizable <a href="https://developers.google.com/web/updates/2015/10/splashscreen?hl=en">splash screen</a>\n            the user sees between tapping the home screen icon and your app’s first paint.',
        type: { name: 'Progressive Web App', contributesToScore: true },
        score:
        {
          overall: 1,
          subItems:
          [{
            value: true,
            rawValue: undefined,
            debugString: undefined,
            optimalValue: undefined,
            extendedInfo: undefined,
            name: 'manifest-exists',
            category: 'Manifest',
            description: 'Manifest exists'
          },
            {
              value: true,
              rawValue: undefined,
              debugString: undefined,
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-name',
              category: 'Manifest',
              description: 'Manifest contains name'
            },
            {
              value: true,
              rawValue: undefined,
              debugString: undefined,
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-background-color',
              category: 'Manifest',
              description: 'Manifest contains background_color'
            },
            {
              value: true,
              rawValue: undefined,
              debugString: undefined,
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-theme-color',
              category: 'Manifest',
              description: 'Manifest contains theme_color'
            },
            {
              value: true,
              rawValue: undefined,
              debugString: 'Found icons of sizes: 192x192,228x228',
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-icons-min-192',
              category: 'Manifest',
              description: 'Manifest contains icons at least 192px'
            },
            ]
        }
      },
      {
        name: 'Address bar matches brand colors',
        shortName: undefined,
        description: 'The browser address bar can be themed to match your site. A theme-color\n            <a href="https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android">meta tag</a>\n            will upgrade the address bar when a user browses the site, and the\n            <a href="https://developers.google.com/web/updates/2015/08/using-manifest-to-set-sitewide-theme-color">manifest theme-color</a>\n            will apply the same theme site-wide once it\'s been added to homescreen.',
        type: { name: 'Progressive Web App', contributesToScore: true },
        score:
        {
          overall: 0.6666666666666666,
          subItems:
          [{
            value: true,
            rawValue: undefined,
            debugString: undefined,
            optimalValue: undefined,
            extendedInfo: undefined,
            name: 'manifest-exists',
            category: 'Manifest',
            description: 'Manifest exists'
          },
            {
              value: true,
              rawValue: undefined,
              debugString: undefined,
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-theme-color',
              category: 'Manifest',
              description: 'Manifest contains theme_color'
            },
            {
              value: false,
              rawValue: undefined,
              debugString: 'No valid theme-color meta tag found.',
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'theme-color-meta',
              category: 'HTML',
              description: 'HTML has a theme-color <meta>'
            },
            ]
        }
      },
      {
        name: 'Design is mobile-friendly',
        shortName: undefined,
        description: 'Users increasingly experience your app on mobile devices, so it\'s important to\n            ensure that the experience can adapt to smaller screens.',
        type: { name: 'Progressive Web App', contributesToScore: true },
        score:
        {
          overall: 1,
          subItems:
          [{
            value: true,
            rawValue: undefined,
            debugString: undefined,
            optimalValue: undefined,
            extendedInfo: undefined,
            name: 'viewport',
            category: 'Mobile Friendly',
            description: 'HTML has a viewport <meta>'
          },
            ]
        }
      },
      {
        name: 'Best Practices',
        shortName: undefined,
        description: '',
        type: { name: 'Best Practices', contributesToScore: false },
        score:
        {
          overall: 1,
          subItems:
          [{
            value: true,
            rawValue: undefined,
            debugString: '',
            optimalValue: undefined,
            extendedInfo: { formatter: 'accessibility', value: undefined },
            name: 'aria-valid-attr',
            category: 'Accessibility',
            description: 'Element aria-* attributes are valid ARIA attributes'
          },
            {
              value: true,
              rawValue: undefined,
              debugString: undefined,
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-short-name-length',
              category: 'Manifest',
              description: 'App\'s short_name won\'t be truncated when displayed on homescreen'
            },
            {
              value: true,
              rawValue: 'standalone',
              debugString: 'Manifest display property should be standalone or fullscreen.',
              optimalValue: undefined,
              extendedInfo: undefined,
              name: 'manifest-display',
              category: 'Manifest',
              description: 'Manifest\'s display property set to “standalone” or “fullscreen” to\n            allow launching without address bar.'
            },
            ]
        }
      },
      ]
  };




var x = reportGenerator.generateHTML(stub, { inline: true });

console.log(x)
