Add unit tests for noiseDetail()
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- testing
Hướng nghiên cứu
Đọc src/math/noise.js xung quanh noiseDetail() và các test hiện có trong test/unit/math/noise.js. Thêm các test để cấu hình octaves và falloff, giá trị không hợp lệ và falloff bị bỏ qua; khôi phục trạng thái mặc định sau đó để các test khác không bị ảnh hưởng. Chạy các test đơn vị của noise và cập nhật bình luận lỗi thời; hoàn thành khi các hành vi được yêu cầu được bao phủ và bộ test vượt qua.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- JavaScript
- Star
- 24.1k
- Fork
- 3.9k
- Merge trung bình
- 3 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 33
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của processing/p5.js
-
[p5.js 2.0+ Bug Report]: SVG importer does not respect preserveAspectRatio="none" for <symbol>/<use>Có thể đã có người làm @Danyccsf đã nhận hôm nay. Đang mởArea:Core p5.js 2.0+
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
processing/p5.js#9257 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[p5.js 2.0+ Bug Report]: storeItem() validation branches are missing `return`, so bad input throws a TypeError or is stored anywayCó thể đã có người làm @iUjjwalRaj đã nhận 2 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
processing/p5.js#9242 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
processing/p5.js#9241 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[p5.js 2.0+ Bug Report]: Typo in Spanish reference documentation for ellipseMode()Có thể đã có người làm @cgutierrezval đã nhận 5 ngày trước. Đang mởInternationalization p5.js 2.0+
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
processing/p5.js#9231 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[p5.js 2.0+ Bug Report]: ReferenceError: p5 is not defined when calling loadPixels/get/copy/mask on p5.MediaElement in ESMCó thể đã có người làm @Pcmhacker-piro đã nhận 10 ngày trước. Đang mởArea:Core Area:DOM
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
processing/p5.js#9189 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của processing/p5.js
Issue tương tự
-
ci-install-db-tools stall-case tests flake: stalled apt-get can be killed before it logs its callĐang mởeffort:low model:light plan planner:opus-5-5 tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug 🐞
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mozilla-mobile/firefox-ios#35986 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Hidden loading spinner keeps animating after connect, causing high idle CPU usage in FirefoxĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
bug(sight): the dashboard's text truncations split surrogate pairs and show broken charactersĐang mởcomponent:sight
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agentic-os-org/ANOLISA#6738 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
mastra-ai/mastra#26470 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày