Shared base #1

Open
Senrokai wants to merge 11 commits from shared-base into main
Showing only changes of commit 2965706b7e - Show all commits
@@ -115,11 +115,12 @@ describe('renderPlanetTexture', () => {
it('produces no NaN or out-of-range bytes for any class', () => { it('produces no NaN or out-of-range bytes for any class', () => {
for (const planetClass of ALL_CLASSES) { for (const planetClass of ALL_CLASSES) {
const pixels = renderPlanetTexture(appearanceOf(planetClass, { polarCapExtentDeg: 30 }), SIZE); const pixels = renderPlanetTexture(appearanceOf(planetClass, { polarCapExtentDeg: 30 }), SIZE);
for (const value of pixels) { // One assertion per class, not three per byte: 245 760 expect() calls ran past the
expect(Number.isInteger(value)).toBe(true); // default 5 s timeout on a slower CI machine.
expect(value).toBeGreaterThanOrEqual(0); const firstBad = pixels.findIndex(
expect(value).toBeLessThanOrEqual(255); (value) => !Number.isInteger(value) || value < 0 || value > 255,
} );
expect(firstBad, planetClass).toBe(-1);
} }
}); });
}); });