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

Obey Law of Demeter for test code #303

Open
kentbull opened this issue Jan 14, 2025 · 2 comments
Open

Obey Law of Demeter for test code #303

kentbull opened this issue Jan 14, 2025 · 2 comments
Labels
enhancement feature request help wanted Extra attention is needed improvement Improvement to the codebase triage Needs assessment

Comments

@kentbull
Copy link
Collaborator

Feature request description/rationale

While looking through the test utilities and other code in the integration tests I noticed that many objects are passed around where values are sufficient and also that some places include multiple level of objects being accessed.

Generally it seems the Law of Demeter, or principle of least knowledge, makes code maintainable with lower cost than without so it would be worth refactoring the testing code to abide by this principle.

This issue is starting as a catch all. I will add specific examples as I come across them again.

@kentbull kentbull added enhancement help wanted Extra attention is needed feature request improvement Improvement to the codebase triage Needs assessment labels Jan 14, 2025
@kentbull
Copy link
Collaborator Author

First example: test-util.ts:getIssuedCredential issuerAID and recipientAID arg that should just be prefixes.

@kentbull
Copy link
Collaborator Author

Next example / instance: test-util.ts:admitSinglesig recipientAid should be recipientPrefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request help wanted Extra attention is needed improvement Improvement to the codebase triage Needs assessment
Projects
None yet
Development

No branches or pull requests

1 participant