{"size": 773, "ext": "js", "max_stars_repo_path": "validate-data/test.js", "max_stars_repo_name": "dmedak/ifg-ticker", "max_stars_repo_stars_event_min_datetime": "2018-07-06T04:10:34.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-20T04:02:25.000Z", "max_issues_repo_path": "validate-data/test.js", "max_issues_repo_name": "jfilter/ifg-feed", "max_issues_repo_issues_event_min_datetime": "2018-07-06T16:37:28.000Z", "max_issues_repo_issues_event_max_datetime": "2019-12-21T17:54:37.000Z", "max_forks_repo_path": "validate-data/test.js", "max_forks_repo_name": "dmedak/ifg-ticker", "max_forks_repo_forks_event_min_datetime": "2018-07-16T18:14:12.000Z", "max_forks_repo_forks_event_max_datetime": "2019-12-20T04:15:59.000Z"}
{"max_stars_count": 8, "max_issues_count": 6, "max_forks_count": 5, "avg_line_length": 24.15625, "max_line_length": 77, "alphanum_fraction": 0.5873221216}
import fs from "fs";

import test from "ava";

test("urls are unique in rssfeeds.json", (t) => {
  const rssfeeds = JSON.parse(fs.readFileSync("../ttnconfig/rssfeeds.json"));
  const urls = rssfeeds.map((x) => x.url);

  const set = new Set();
  const duplicates = new Set();

  urls.forEach((x) => {
    if (set.has(x)) {
      duplicates.add(x);
    }
    set.add(x);
  });

  t.true(
    duplicates.size === 0,
    "The following URLs are duplicated: " + Array.from(duplicates).join(" ")
  );
});

test("all urls start with https:// or http://", (t) => {
  const rssfeeds = JSON.parse(fs.readFileSync("../ttnconfig/rssfeeds.json"));
  const urls = rssfeeds.map((x) => x.url);
  t.true(
    urls.every((x) => x.startsWith("https://") || x.startsWith("http://"))
  );
});
