Contributing to yahoofinancer
Source:CONTRIBUTING.md
Thank you for your interest in contributing to yahoofinancer!
Hermetic Testing Policy
All tests in yahoofinancer must run completely offline and hermetically. Tests must never issue network requests to live Yahoo Finance servers during test execution or CI.
Mocking Mechanisms
Two testing patterns are supported:
-
Custom Helper
with_mock_api()(tests/testthat/helper-mocks.R):- Injects mocked HTTP responses via
testthat::with_mocked_bindingsonhttr2and package internals. - Build responses with
mock_response(status_code = 200, body_json = list(...)).
- Injects mocked HTTP responses via
-
httptest2Fixtures (tests/testthat/setup-httptest2.R):- Recorded JSON fixtures located in
tests/testthat/api/**. - All URLs are redacted to keep file paths under CRAN’s 100-character tarball portability limit.
- Recorded JSON fixtures located in