Skip to content

Commit bf8850d

Browse files
test: snapshot the minified output the export produces
Both assertions check printed code, which the testing guide says to snapshot rather than pin with `toBe` -- a hand-written expectation over one string ignores every other byte the printer emits. The recorded values are unchanged.
1 parent a21426a commit bf8850d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎test/CssSyntax.unittest.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9907,6 +9907,6 @@ describe("cssMinify export", () => {
99079907

99089908
const { code } = await cssMinify({ "a.css": "a {\n\tcolor: red;\n}\n" });
99099909

9910-
expect(code).toBe("a{color:red}");
9910+
expect(code).toMatchInlineSnapshot('"a{color:red}"');
99119911
});
99129912
});

‎test/HtmlSyntax.unittest.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9094,6 +9094,6 @@ describe("htmlMinify export", () => {
90949094
});
90959095

90969096
// `</p>` is an optional end tag, so minifying drops it.
9097-
expect(code).toBe("<p class=x> a ");
9097+
expect(code).toMatchInlineSnapshot('"<p class=x> a "');
90989098
});
90999099
});

0 commit comments

Comments
 (0)