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

Add some initial api tests for budgets and accounts #1991

Merged
merged 5 commits into from
Dec 2, 2023

Conversation

twk3
Copy link
Contributor

@twk3 twk3 commented Nov 28, 2023

  • 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

The test setup is based on what was done for server/main.test.ts (and reuses it's mock databaseFiles)

Part of #1074

@trafico-bot trafico-bot bot added the 🚧 WIP label Nov 28, 2023
Copy link

netlify bot commented Nov 28, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 865fc62
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/65692a4ea7f6d20008ca689e
😎 Deploy Preview https://deploy-preview-1991.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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
@twk3 twk3 force-pushed the initial-api-tests branch from 42243f9 to d54f227 Compare November 28, 2023 21:30
Copy link
Contributor

github-actions bot commented Nov 28, 2023

Bundle Stats — desktop-client

Hey 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

Files count Total bundle size % Changed
16 3.08 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/main.js 1.17 MB 0%
static/js/665.chunk.js 824.28 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/444.chunk.js 156.11 kB 0%
static/js/821.chunk.js 121.15 kB 0%
static/js/231.chunk.js 117.37 kB 0%
static/js/wide-components.chunk.js 113.85 kB 0%
static/js/reports.chunk.js 74.96 kB 0%
static/js/narrow-components.chunk.js 52.93 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 2.07 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 911 B 0%

Copy link
Contributor

github-actions bot commented Nov 28, 2023

Bundle Stats — loot-core

Hey 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

Files count Total bundle size % Changed
2 2.22 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.23 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

@twk3 twk3 changed the title [WIP] Add some initial api tests for budgets and accounts Add some initial api tests for budgets and accounts Nov 28, 2023
Copy link
Member

@MatissJanis MatissJanis left a 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!

packages/api/tsconfig.dist.json Outdated Show resolved Hide resolved
@twk3
Copy link
Contributor Author

twk3 commented Dec 1, 2023

@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.

@twk3 twk3 requested a review from MatissJanis December 1, 2023 00:45
Copy link
Member

@MatissJanis MatissJanis left a 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.

@MatissJanis MatissJanis merged commit 8b20169 into actualbudget:master Dec 2, 2023
19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Dec 2, 2023
@twk3 twk3 mentioned this pull request Dec 5, 2023
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants