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

Improve unit tests #413

Open
49 tasks
Gudahtt opened this issue Mar 18, 2021 · 0 comments
Open
49 tasks

Improve unit tests #413

Gudahtt opened this issue Mar 18, 2021 · 0 comments
Labels

Comments

@Gudahtt
Copy link
Member

Gudahtt commented Mar 18, 2021

This is a tracking issue for improving unit tests in various ways.

Related issues:

Some general advice: writing unit tests should be easy. They may be verbose and time consuming to write, but they should be easy. If it's not easy, change the API under test to make it easy.

Many of the APIs in this repository make unit testing difficult. Your time is better spent improving the API first and writing simple unit tests, rather than struggling to write complex tests for a complex API. Consider ways to reduce the API surface, reduce dependencies, inject dependencies to simplify stubbing, and move complex functionality into separate modules.

Tracker by module:

Check off each module as they are audited for each of the criteria outlined above.

  • ./src/announcement/AnnouncementController.test.ts
  • ./src/permissions/Caveat.test.ts
  • ./src/permissions/PermissionController.test.ts
  • ./src/permissions/rpc-methods/requestPermissions.test.ts
  • ./src/permissions/rpc-methods/getPermissions.test.ts
  • ./src/permissions/errors.test.ts
  • ./src/permissions/Permission.test.ts
  • ./src/keyring/KeyringController.test.ts
  • ./src/notification/NotificationController.test.ts
  • ./src/third-party/EnsController.test.ts
  • ./src/third-party/PhishingController.test.ts
  • ./src/BaseControllerV2.test.ts
  • ./src/message-manager/MessageManager.test.ts
  • ./src/message-manager/AbstractMessageManager.test.ts
  • ./src/message-manager/PersonalMessageManager.test.ts
  • ./src/message-manager/TypedMessageManager.test.ts
  • ./src/assets/AccountTrackerController.test.ts
  • ./src/assets/AssetsContractController.test.ts
  • ./src/assets/NftController.test.ts
  • ./src/assets/assetsUtil.test.ts
  • ./src/assets/CurrencyRateController.test.ts
  • ./src/assets/TokenBalancesController.test.ts
  • ./src/assets/TokenListController.test.ts
  • ./src/assets/TokenDetectionController.test.ts
  • ./src/assets/NftDetectionController.test.ts
  • ./src/assets/TokensController.test.ts
  • ./src/assets/TokenRatesController.test.ts
  • ./src/assets/Standards/NftStandards/ERC721/ERC721Standard.test.ts
  • ./src/assets/Standards/NftStandards/ERC1155/ERC1155Standard.test.ts
  • ./src/assets/Standards/ERC20Standard.test.ts
  • ./src/user/AddressBookController.test.ts
  • ./src/user/PreferencesController.test.ts
  • ./src/subject-metadata/SubjectMetadataController.test.ts
  • ./src/network/NetworkController.test.ts
  • ./src/ControllerMessenger.test.ts
  • ./src/ratelimit/RateLimitController.test.ts
  • ./src/gas/fetchGasEstimatesViaEthFeeHistory.test.ts
  • ./src/gas/fetchGasEstimatesViaEthFeeHistory/calculateGasFeeEstimatesForPriorityLevels.test.ts
  • ./src/gas/gas-util.test.ts
  • ./src/gas/determineGasFeeCalculations.test.ts
  • ./src/gas/fetchBlockFeeHistory.test.ts
  • ./src/gas/GasFeeController.test.ts
  • ./src/BaseController.test.ts
  • ./src/ComposableController.test.ts
  • ./src/transaction/TransactionController.test.ts
  • ./src/util.test.ts
  • ./src/apis/crypto-compare.test.ts
  • ./src/apis/token-service.test.ts
  • ./src/approval/ApprovalController.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants