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

test: test helper functions #151

Merged
merged 5 commits into from
Jan 6, 2025
Merged

test: test helper functions #151

merged 5 commits into from
Jan 6, 2025

Conversation

zz-hh-aa
Copy link
Collaborator

What's new in this PR

A testHelpers.ts file, which contains:

  • helper functions that instantiate all relevant classes with simplified values
  • TSdoc for each function

Why

When writing a test for the Lifetime class, I realised that it needs all four tenure classes as well as the Property class, which contain sub-classes too. Not only was it too messy to instantiate all of that in the Lifetime.test.ts file, but I realised that we were creating many instances of these classes and their sub-classes across the test files, and thought it would be straightforward for all testing to have a set of helper functions that instantiate them with default values.

Copy link

vercel bot commented Nov 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fairhold-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 9:24am

@zz-hh-aa zz-hh-aa changed the base branch from main to oz/resale-values November 28, 2024 17:08
@zz-hh-aa zz-hh-aa requested a review from a team November 29, 2024 09:24
@zz-hh-aa zz-hh-aa marked this pull request as ready for review November 29, 2024 11:13
@zz-hh-aa
Copy link
Collaborator Author

Following dev call today, just noting that Claude suggested we go with this route because

  • we are dealing with complex class instances and these functions will instantiate actual instances of our production code
  • using functions means we won't accidentally stub behaviour that we want to test
  • if class interfaces change, TypeScript will catch errors

@zz-hh-aa
Copy link
Collaborator Author

zz-hh-aa commented Dec 5, 2024

This branches from oz/resale-values which branches from oz/depreciation-update (where the test issue should be resolved).

@zz-hh-aa zz-hh-aa changed the base branch from oz/resale-values to main December 9, 2024 09:24
@zz-hh-aa zz-hh-aa changed the base branch from main to oz/resale-values December 9, 2024 09:25
@zz-hh-aa zz-hh-aa merged commit 44a58eb into oz/resale-values Jan 6, 2025
2 checks passed
@zz-hh-aa zz-hh-aa deleted the oz/test-helpers branch January 6, 2025 11:18
@zz-hh-aa zz-hh-aa restored the oz/test-helpers branch January 6, 2025 13:22
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