function getMetricsCoveredByTests(spec) {
  const debug = require("debug")("metricsCovered");

  var covered = {};

  spec.forEach((testCase) => {
    debug(testCase.label || testCase.url);

    Object.keys(testCase.metrics || {}).forEach((metric) => {
      covered[metric] = true;
    });

    Object.keys(testCase.offenders || {}).forEach((metric) => {
      covered[metric] = true;
    });
  });

  return Object.keys(covered);
}
Generates metadata.json file that stores metadata about:

- events
- metrics
- modules
- extensions