Skip to content

Conversation

@raju-opti
Copy link
Contributor

Summary

Test plan

Issues

  • FSSDK-12097

@coveralls
Copy link

coveralls commented Dec 3, 2025

Coverage Status

coverage: 77.752%. remained the same
when pulling 68d6618 on raju/usercontext
into fe00123 on master.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the OptimizelyUserContext test suite from JavaScript (using Chai/Sinon) to TypeScript with vitest. The refactoring modernizes the test infrastructure while maintaining comprehensive test coverage for user context functionality including attribute management, decision-making, forced decisions, and segment qualification.

Key Changes

  • Migrated from Chai assertions to vitest's expect API
  • Replaced Sinon mocks with vitest's vi.fn() mocking utilities
  • Updated mock helpers to use TypeScript types and standardized mock functions (getMockLogger, getMockEventDispatcher)
  • Removed deprecated parameters (shouldIdentifyUser, isValidInstance, eventBatchSize) that are no longer part of the API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@junaed-optimizely junaed-optimizely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! For completeness, we can add tests for the async variants as well.

@raju-opti raju-opti merged commit 5d1b6be into master Dec 5, 2025
15 of 17 checks passed
@raju-opti raju-opti deleted the raju/usercontext branch December 5, 2025 14:00
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.

4 participants