-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add some initial api tests for budgets and accounts #1991
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
- Adds jest config for the api package - Reuse setup from loot-core, as we are loading it's server/main anyways - Cover some basic budget and account tests to prove it out
42243f9
to
d54f227
Compare
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see some more tests!
- Switch test to typescript - Drop loot-core imports, use only api and node modules
@MatissJanis I addressed your feedback. Everything went pretty smooth, I added the mocks/budget to the watch ignore so it shouldn't loop. Other than what you requested (typescript, drop the loot-core imports), the main other thing I had to do was have the test script build the api prior to testing. Otherwise we don't have a bundle for the index to import. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing! Thanks for your hard work on the API tests. This will definitely make things more stable in the future.
The test setup is based on what was done for server/main.test.ts (and reuses it's mock databaseFiles)
Part of #1074