co2-compensator
Version:
Work out and offset the co2 of your digital services
32 lines (27 loc) • 898 B
JavaScript
;
const hosting = require("./hosting-json");
const path = require("path");
describe("hostingJSON", function() {
const jsonPath = path.resolve(
__dirname,
"..",
"data",
"fixtures",
"url2green.test.json"
);
describe("checking a single domain with #check", function() {
test("against the list of domains as JSON", async function() {
const db = await hosting.loadJSON(jsonPath);
const res = await hosting.check("google.com", db);
expect(res).toEqual(true);
});
});
describe("implicitly checking multiple domains with #check", function() {
test("against the list of domains as JSON", async function() {
const db = await hosting.loadJSON(jsonPath);
const domains = ["google.com", "kochindustries.com"];
const res = await hosting.check(domains, db);
expect(res).toContain("google.com");
});
});
});