Skip to content

Conversation

@jaredmixpanel
Copy link
Collaborator

Summary

Changes

  • Created new test file __tests__/config.test.js with 16 test cases
  • Tests all edge cases including falsy values (false, 0, null, undefined, empty string)
  • Verifies multi-token support and config isolation
  • Includes regression tests specifically labeled to prevent issue Bug: IP geolocation cannot be turned off #315 from recurring

Testing

  • All 122 tests pass including the 16 new tests
  • No regressions in existing functionality
  • Verified that false values now correctly persist as expected

Why This Matters

The original bug made it impossible to disable IP-based geolocation tracking, which has privacy and GDPR implications. This test suite ensures the fix remains effective and prevents future regressions.

Test Coverage Areas

  1. Default Behavior - Returns true when not configured
  2. Explicit Values - Correctly handles true and false
  3. Falsy Values - Properly returns all falsy values without defaulting to true
  4. Multi-Token Support - Independent configs per token
  5. Integration - Correct conversion for network layer IP parameter

- Add tests to verify false values are correctly returned (fixes #315)
- Test all falsy values (false, 0, null, undefined, empty string)
- Add regression tests to prevent the bug from recurring
- Test multi-token support and config isolation
- Verify integration with network layer IP parameter conversion
- Ensure default behavior returns true when not configured

This prevents regression of the bug where getUseIpAddressForGeolocation
always returned true due to the || true fallback, making it impossible
to disable IP-based geolocation.
@jaredmixpanel jaredmixpanel merged commit 14c06c6 into master Dec 15, 2025
7 of 9 checks passed
@jaredmixpanel jaredmixpanel deleted the add-geolocation-config-tests branch December 15, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants