Skip to content

Commit

Permalink
check that SWD v3 returns the expected properties
Browse files Browse the repository at this point in the history
  • Loading branch information
fershad committed Jun 12, 2024
1 parent c456d79 commit e7cf17b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/co2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,33 @@ describe("co2", () => {
co2.perVisit(MILLION, true)
);
});

it("returns the expected properties", () => {
expect(co2.perByteTrace(MILLION)).toHaveProperty("co2");
expect(co2.perByteTrace(MILLION)).toHaveProperty("variables");
expect(co2.perByteTrace(MILLION)).toHaveProperty("green");
expect(co2.perByteTrace(MILLION)).toHaveProperty(
"variables.gridIntensity"
);
expect(co2.perByteTrace(MILLION)).not.toHaveProperty(
"variables.firstVisitPercentage"
);
expect(co2.perVisitTrace(MILLION)).toHaveProperty("co2");
expect(co2.perVisitTrace(MILLION)).toHaveProperty("variables");
expect(co2.perVisitTrace(MILLION)).toHaveProperty("green");
expect(co2.perVisitTrace(MILLION)).toHaveProperty(
"variables.gridIntensity"
);
expect(co2.perVisitTrace(MILLION)).toHaveProperty(
"variables.firstVisitPercentage"
);
expect(co2.perVisitTrace(MILLION)).toHaveProperty(
"variables.returnVisitPercentage"
);
expect(co2.perVisitTrace(MILLION)).toHaveProperty(
"variables.dataReloadRatio"
);
});
});

describe("Using custom grid intensity", () => {
Expand Down

0 comments on commit e7cf17b

Please sign in to comment.