Skip to content

Commit

Permalink
test: check flaws with toEqual()
Browse files Browse the repository at this point in the history
If we encounter flaws unexpectedly, this surfaces it in the output.
  • Loading branch information
caugner committed May 20, 2022
1 parent b00d898 commit 20281d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion testing/tests/developing.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ test.describe("Testing the kitchensink page", () => {
).json();

expect(doc.title).toBe("The MDN Content Kitchensink");
expect(Object.keys(doc.flaws).length).toBe(0);
expect(doc.flaws).toEqual({});
});

// XXX Do more advanced tasks that test the server and document "CRUD operations"
Expand Down
4 changes: 2 additions & 2 deletions testing/tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ test("img tags without 'src' should not crash", () => {
);
const jsonFile = path.join(builtFolder, "index.json");
const { doc } = JSON.parse(fs.readFileSync(jsonFile));
expect(Object.keys(doc.flaws).length).toBe(0);
expect(doc.flaws).toEqual({});
});

test("/Web/Embeddable should have 3 valid live samples", () => {
Expand All @@ -1413,7 +1413,7 @@ test("/Web/Embeddable should have 3 valid live samples", () => {

const jsonFile = path.join(builtFolder, "index.json");
const { doc } = JSON.parse(fs.readFileSync(jsonFile));
expect(Object.keys(doc.flaws).length).toBe(0);
expect(doc.flaws).toEqual({});

const builtFiles = fs.readdirSync(path.join(builtFolder));
expect(
Expand Down

0 comments on commit 20281d2

Please sign in to comment.