Skip to content

Commit 412ed27

Browse files
test: shorten the new comments to the test-file convention
1 parent db6a2ac commit 412ed27

2 files changed

Lines changed: 8 additions & 17 deletions

File tree

‎test/CssSyntax.unittest.js‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7161,25 +7161,21 @@ describe("SourceProcessor — renderEmbeddedSource over a data: url", () => {
71617161
it("offers every language `EMBEDDED_LANGUAGES` names, and prints each answer", () => {
71627162
const { EMBEDDED_LANGUAGES } = require("../lib/css/syntax");
71637163

7164-
// One stylesheet reaching every language a `data:` payload's media type can
7165-
// name, an `@import` among them.
7164+
// One stylesheet reaching every language a media type can name.
71667165
const sheet =
71677166
'@import url("data:text/css,.inner { color : red }");' +
71687167
'.svg{background:url("data:image/svg+xml,<svg> <rect/> </svg>")}' +
71697168
'.html{background:url("data:text/html,<p> x </p>")}' +
71707169
".json{background:url('data:application/json,{ \"a\" : 1 }')}" +
71717170
'.js{background:url("data:text/javascript,var a = 1")}';
71727171

7173-
// The list is what a caller reads to say up front which languages it
7174-
// handles, so every entry needs a live offer site behind it, and nothing
7175-
// may arrive that the list does not name. Asserted over the whole set
7176-
// rather than per payload: either half drifting is what this catches.
7172+
// Every entry needs a live offer site behind it, and nothing may arrive
7173+
// that the list does not name.
71777174
expect([...new Set(offered(sheet).map(([type]) => type))].sort()).toEqual(
71787175
[...EMBEDDED_LANGUAGES].sort()
71797176
);
71807177

7181-
// And what the renderer answered is what the stylesheet carries — being
7182-
// offered a payload is only half of minifying it.
7178+
// Being offered a payload is only half of minifying it.
71837179
expect(minify(sheet, (source, { type }) => `/*${type}*/`)).toBe(
71847180
"@import url(data:text/css,/*css*/);" +
71857181
".svg{background:url(data:image/svg+xml,/*svg*/)}" +

‎test/HtmlSyntax.unittest.js‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5320,9 +5320,7 @@ describe("SourceProcessor — renderEmbeddedSource", () => {
53205320
it("offers every language `EMBEDDED_LANGUAGES` names, and prints each answer", () => {
53215321
const { EMBEDDED_LANGUAGES } = require("../lib/html/syntax");
53225322

5323-
// One document reaching every offer site: an inline `<style>`, a `<script>`,
5324-
// a JSON `<script>`, a `style` attribute, an `<svg>` subtree and the
5325-
// document an `<iframe srcdoc>` holds.
5323+
// One document reaching every offer site, an `<iframe srcdoc>` among them.
53265324
const html =
53275325
"<style> .a { color : red } </style>" +
53285326
"<script> var a = 1 </script>" +
@@ -5331,16 +5329,13 @@ describe("SourceProcessor — renderEmbeddedSource", () => {
53315329
'<svg viewBox="0 0 2 2"> <rect/> </svg>' +
53325330
'<iframe srcdoc="&lt;p&gt; inner &lt;/p&gt;"></iframe>';
53335331

5334-
// The list is what a caller reads to say up front which languages it
5335-
// handles, so every entry needs a live offer site behind it, and nothing
5336-
// may arrive that the list does not name. Asserted over the whole set
5337-
// rather than per site: either half drifting is what this catches.
5332+
// Every entry needs a live offer site behind it, and nothing may arrive
5333+
// that the list does not name.
53385334
expect([...new Set(offered(html).map(([type]) => type))].sort()).toEqual(
53395335
[...EMBEDDED_LANGUAGES].sort()
53405336
);
53415337

5342-
// And what the renderer answered is what the serialization carries — being
5343-
// offered a body is only half of minifying it.
5338+
// Being offered a body is only half of minifying it.
53445339
expect(minify(html, (source, { type }) => `/*${type}*/`)).toBe(
53455340
"<style>/*css*/</style>" +
53465341
"<script>/*javascript*/</script>" +

0 commit comments

Comments
 (0)