Skip to content

Commit a32e693

Browse files
test(css): type the hue-method helper the strict test project checks
`tsconfig.types.test.json` runs with `checkJs` and `strict`, so the helper's parameters and the two color pairs spread into it need their types stated. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018tNx7sU4SbnKFhFeofDVr5
1 parent 70ea6e4 commit a32e693

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎test/CssSyntax.unittest.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8006,11 +8006,19 @@ describe("CssSyntax minify — color-mix()", () => {
80068006
// Each method takes the second hue its own way round the circle. Two pairs,
80078007
// since one only ever tells the two arcs apart: which of them is the
80088008
// shorter is also which of them increases.
8009+
/**
8010+
* @param {string} method the hue interpolation method
8011+
* @param {string} first the first color
8012+
* @param {string} second the second color
8013+
* @returns {string} the minified declaration
8014+
*/
80098015
const mix = (method, first, second) =>
80108016
minify(`a{color:color-mix(in hsl ${method} hue,${first} 30%,${second})}`);
8017+
/** @type {[string, string]} */
80118018
const rising = ["#804d4d", "#4d8080"];
80128019
expect(mix("shorter", ...rising)).toBe("a{color:#4d8052}");
80138020
expect(mix("decreasing", ...rising)).toBe("a{color:#4d5280}");
8021+
/** @type {[string, string]} */
80148022
const falling = ["#4d8080", "#804d4d"];
80158023
expect(mix("longer", ...falling)).toBe("a{color:#807b4d}");
80168024
expect(mix("increasing", ...falling)).toBe("a{color:#804d7b}");

0 commit comments

Comments
 (0)