Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(beta): migrate to TypeScript #2058

Merged
merged 2 commits into from
Jun 3, 2021
Merged

refactor(beta): migrate to TypeScript #2058

merged 2 commits into from
Jun 3, 2021

Conversation

LoneRifle
Copy link
Collaborator

Problem

Closes #1506

Solution

  • Provide test coverage via jest, crowbar-ing a mock into the angular
    global at runtime, to minimise changes to the module under test
    • Restructure betas.client.factory so that its functions are
      accessible both via module import and angular.module().factory()
  • Allow the functions to take in other beta feature fields for test
    purposes, defaulting to BETA_FEATURES_FIELD
  • Migrate betas.client.factory to the TypeScript-based BetaService

In preparation to porting betas.client.factory to TypeScript, write a
suite of unit tests to ensure functionality does not change during the
migration. Restructure the AngularJS factory a bit to make code paths
easy to reach.

- Restructure `betas.client.factory` so that its functions are
  accessible both via module import and `angular.module().factory()`
- Allow the functions to take in other beta feature fields for test
  purposes, defaulting to `BETA_FEATURES_FIELD`
- Provide test coverage via jest, crowbar-ing a mock into the angular
  global at runtime, to minimise changes to the module under test
@LoneRifle LoneRifle requested review from karrui and mantariksh June 2, 2021 11:03
Copy link
Contributor

@liangyuanruo liangyuanruo left a comment

Choose a reason for hiding this comment

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

lgtm otherwise!

@LoneRifle LoneRifle merged commit f02fdb9 into develop Jun 3, 2021
@LoneRifle LoneRifle deleted the refactor/beta/ts branch June 3, 2021 05:54
@karrui karrui mentioned this pull request Jun 8, 2021
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.

Migrate betas.client.factory.js to TypeScript
3 participants