Test de texture : une assertion par classe au lieu de trois par octet
node / check (pull_request) Failing after 20m2s
CI / ci (pull_request) Failing after 20m2s

245 760 appels à expect() (10 classes × 8 192 octets × 3) dépassaient le délai de
5 s par défaut sur le runner Gitea (1,4 s ici) ; le test tombe à 11 ms. Même
vérification, même résultat.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-10-01 18:24:08 +02:00
co-authored by Claude Opus 5.5
parent 243aa3bbce
commit 2965706b7e
@@ -115,11 +115,12 @@ describe('renderPlanetTexture', () => {
it('produces no NaN or out-of-range bytes for any class', () => {
for (const planetClass of ALL_CLASSES) {
const pixels = renderPlanetTexture(appearanceOf(planetClass, { polarCapExtentDeg: 30 }), SIZE);
for (const value of pixels) {
expect(Number.isInteger(value)).toBe(true);
expect(value).toBeGreaterThanOrEqual(0);
expect(value).toBeLessThanOrEqual(255);
}
// One assertion per class, not three per byte: 245 760 expect() calls ran past the
// default 5 s timeout on a slower CI machine.
const firstBad = pixels.findIndex(
(value) => !Number.isInteger(value) || value < 0 || value > 255,
);
expect(firstBad, planetClass).toBe(-1);
}
});
});