Add unit tests for noiseDetail()
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 75/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- testing
Línea de trabajo
Lee src/math/noise.js en la zona de noiseDetail() y los tests existentes en test/unit/math/noise.js. Añade tests para configurar octaves y falloff, valores inválidos y falloff omitido; restaura el estado predeterminado después para que otros tests no se vean afectados. Ejecuta los tests unitarios de noise y actualiza el comentario obsoleto; listo cuando los comportamientos solicitados estén cubiertos y la suite pase.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Increasing access
Tests make noiseDetail()'s behaviour explicit and protect it from regressions, so sketches that rely on it keep working across releases. They also give new contributors a clear reference for how the function is meant to behave.
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
Feature enhancement details
noiseDetail() (src/math/noise.js:403-410) has no unit tests. test/unit/math/noise.js:19 notes this:
// ALso need test for noiseSeed and noiseDetail
noiseSeed has since been covered (lines 36-60), but noiseDetail hasn't.
The private getters _getNoiseOctaves() and _getNoiseAmpFalloff() (lines 416-425) make the state directly assertable. Proposed tests:
- sets octaves and falloff when both are given
- ignores
lod <= 0andfalloff <= 0, keeping the previous values - when
falloffis omitted it defaults to 0.5, so a previously set falloff is reset rather than kept
Since the suite shares one mockP5Prototype and noiseDetail state persists in the module closure, the new tests would restore the defaults (4 octaves, 0.5 falloff) afterwards so the existing noise() tests aren't affected.
I'd also update the comment at line 19, since noiseSeed is now tested.
Checked against main at 3193703. The strands noiseDetail tests in the WebGL/WebGPU shader suites cover state leaking between shaders, not this function.
I'd like to fix this myself if approved.
- Lenguaje dominante
- JavaScript
- Estrellas
- 24.1k
- Forks
- 3.9k
- Merge medio
- 3 d 19 h
- PR fusionados (30 d)
- 33
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de processing/p5.js
-
[p5.js 2.0+ Bug Report]: SVG importer does not respect preserveAspectRatio="none" for <symbol>/<use>Posiblemente ocupada @Danyccsf la tomó hoy. AbiertoArea:Core p5.js 2.0+
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
processing/p5.js#9257 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
[p5.js 2.0+ Bug Report]: storeItem() validation branches are missing `return`, so bad input throws a TypeError or is stored anywayPosiblemente ocupada @iUjjwalRaj la tomó hace 2 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
processing/p5.js#9242 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
processing/p5.js#9241 ·
Los mantenedores suelen responder en 2 días
-
[p5.js 2.0+ Bug Report]: Typo in Spanish reference documentation for ellipseMode()Posiblemente ocupada @cgutierrezval la tomó hace 5 días. AbiertoInternationalization p5.js 2.0+
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
processing/p5.js#9231 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
[p5.js 2.0+ Bug Report]: ReferenceError: p5 is not defined when calling loadPixels/get/copy/mask on p5.MediaElement in ESMPosiblemente ocupada @Pcmhacker-piro la tomó hace 10 días. AbiertoArea:Core Area:DOM
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
processing/p5.js#9189 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de processing/p5.js
Issues similares
-
ci-install-db-tools stall-case tests flake: stalled apt-get can be killed before it logs its callAbiertoeffort:low model:light plan planner:opus-5-5 tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Bug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mozilla-mobile/firefox-ios#35986 ·
Los mantenedores suelen responder en 1 día
-
Hidden loading spinner keeps animating after connect, causing high idle CPU usage in FirefoxAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
bug(sight): the dashboard's text truncations split surrogate pairs and show broken charactersAbiertocomponent:sight
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agentic-os-org/ANOLISA#6738 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
mastra-ai/mastra#26470 · 1 comentario ·
Los mantenedores suelen responder en 1 día