[PR #6871] [MERGED] Migrate setupTests.js to TypeScript with proper types #32714

Closed
opened 2026-04-18 08:43:07 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6871
Author: @Copilot
Created: 2/5/2026
Status: Merged
Merged: 2/10/2026
Merged by: @joel-jeremy

Base: react-query-useTransactionsHead: copilot/sub-pr-6757


📝 Commits (5)

  • c7c7917 Initial plan
  • bb1c082 Rename setupTests.js to setupTests.ts and add proper types
  • dd7bbbd Extract Size type to avoid duplication
  • 2fef2bc Add release note for setupTests TypeScript migration
  • 3980bd2 Rename release note file to match PR number 6871

📊 Changes

3 files changed (+21 additions, -6 deletions)

View changed files

📝 packages/desktop-client/src/setupTests.ts (+13 -4)
📝 packages/desktop-client/vite.config.mts (+2 -2)
upcoming-release-notes/6871.md (+6 -0)

📄 Description

  • Rename setupTests.js to setupTests.ts
  • Add proper TypeScript types for global declarations
  • Update vite.config.mts to reference setupTests.ts
  • Add proper typing for AutoSizerProps with extracted Size type
  • Add proper typing for process error handler
  • Use vitest's global afterEach instead of global.afterEach
  • Run type checking to ensure no errors
  • Run tests to ensure everything works
  • Address code review feedback
  • Add release note under Maintenance category (6871.md)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 28 14.56 MB → 14.56 MB (-876 B) -0.01%
loot-core 1 5.86 MB → 5.85 MB (-3.03 kB) -0.05%
api 1 4.39 MB → 4.39 MB (-2.67 kB) -0.06%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
28 14.56 MB → 14.56 MB (-876 B) -0.01%
Changeset
File Δ Size
src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx 📈 +247 B (+0.86%) 28.06 kB → 28.3 kB
src/components/Modals.tsx 📉 -163 B (-1.14%) 13.96 kB → 13.8 kB
src/components/reports/reports/CustomReport.tsx 📉 -719 B (-2.74%) 25.6 kB → 24.89 kB
src/components/payees/PayeeTable.tsx 📉 -241 B (-8.00%) 2.94 kB → 2.71 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller

Asset File Size % Changed
static/js/ReportRouter.js 1.11 MB → 1.11 MB (-719 B) -0.06%
static/js/index.js 9.31 MB → 9.31 MB (-157 B) -0.00%

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/da.js 106.62 kB 0%
static/js/de.js 178.39 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 164.16 kB 0%
static/js/es.js 173.83 kB 0%
static/js/fr.js 179.62 kB 0%
static/js/it.js 171.44 kB 0%
static/js/nb-NO.js 157.23 kB 0%
static/js/nl.js 106.65 kB 0%
static/js/pl.js 88.64 kB 0%
static/js/pt-BR.js 146.51 kB 0%
static/js/ru.js 106.97 kB 0%
static/js/sv.js 78.2 kB 0%
static/js/th.js 182.35 kB 0%
static/js/uk.js 215.11 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/narrow.js 641.1 kB 0%
static/js/TransactionList.js 105.97 kB 0%
static/js/wide.js 163.86 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 11.79 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.86 MB → 5.85 MB (-3.03 kB) -0.05%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/importers/ynab5.ts 📉 -3.03 kB (-10.78%) 28.13 kB → 25.09 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.C30497Fh.js 0 B → 5.85 MB (+5.85 MB) -

Removed

Asset File Size % Changed
kcab.worker.CiaHZEop.js 5.86 MB → 0 B (-5.86 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
1 4.39 MB → 4.39 MB (-2.67 kB) -0.06%
Changeset
File Δ Size
src/server/importers/ynab5.ts 📉 -2.67 kB (-10.63%) 25.14 kB → 22.47 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller

Asset File Size % Changed
bundle.api.js 4.39 MB → 4.39 MB (-2.67 kB) -0.06%

Unchanged
No assets were unchanged


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/6871 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 2/5/2026 **Status:** ✅ Merged **Merged:** 2/10/2026 **Merged by:** [@joel-jeremy](https://github.com/joel-jeremy) **Base:** `react-query-useTransactions` ← **Head:** `copilot/sub-pr-6757` --- ### 📝 Commits (5) - [`c7c7917`](https://github.com/actualbudget/actual/commit/c7c7917f7837ca32b6a431d97b210487e0787ad5) Initial plan - [`bb1c082`](https://github.com/actualbudget/actual/commit/bb1c0829e19fe97c1ba03a1a8d44885e59070f27) Rename setupTests.js to setupTests.ts and add proper types - [`dd7bbbd`](https://github.com/actualbudget/actual/commit/dd7bbbd946010ed92e2e36d23fedbde0710d5a1c) Extract Size type to avoid duplication - [`2fef2bc`](https://github.com/actualbudget/actual/commit/2fef2bc9771df283baf537a7b0bd45aa40400419) Add release note for setupTests TypeScript migration - [`3980bd2`](https://github.com/actualbudget/actual/commit/3980bd23804196bffe5180b2ccf293ad2a5c6b90) Rename release note file to match PR number 6871 ### 📊 Changes **3 files changed** (+21 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/setupTests.ts` (+13 -4) 📝 `packages/desktop-client/vite.config.mts` (+2 -2) ➕ `upcoming-release-notes/6871.md` (+6 -0) </details> ### 📄 Description - [x] Rename setupTests.js to setupTests.ts - [x] Add proper TypeScript types for global declarations - [x] Update vite.config.mts to reference setupTests.ts - [x] Add proper typing for AutoSizerProps with extracted Size type - [x] Add proper typing for process error handler - [x] Use vitest's global afterEach instead of global.afterEach - [x] Run type checking to ensure no errors - [x] Run tests to ensure everything works - [x] Address code review feedback - [x] Add release note under Maintenance category (6871.md) <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 28 | 14.56 MB → 14.56 MB (-876 B) | -0.01% loot-core | 1 | 5.86 MB → 5.85 MB (-3.03 kB) | -0.05% api | 1 | 4.39 MB → 4.39 MB (-2.67 kB) | -0.06% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 28 | 14.56 MB → 14.56 MB (-876 B) | -0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx` | 📈 +247 B (+0.86%) | 28.06 kB → 28.3 kB `src/components/Modals.tsx` | 📉 -163 B (-1.14%) | 13.96 kB → 13.8 kB `src/components/reports/reports/CustomReport.tsx` | 📉 -719 B (-2.74%) | 25.6 kB → 24.89 kB `src/components/payees/PayeeTable.tsx` | 📉 -241 B (-8.00%) | 2.94 kB → 2.71 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** Asset | File Size | % Changed ----- | --------- | --------- static/js/ReportRouter.js | 1.11 MB → 1.11 MB (-719 B) | -0.06% static/js/index.js | 9.31 MB → 9.31 MB (-157 B) | -0.00% **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/da.js | 106.62 kB | 0% static/js/de.js | 178.39 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 164.16 kB | 0% static/js/es.js | 173.83 kB | 0% static/js/fr.js | 179.62 kB | 0% static/js/it.js | 171.44 kB | 0% static/js/nb-NO.js | 157.23 kB | 0% static/js/nl.js | 106.65 kB | 0% static/js/pl.js | 88.64 kB | 0% static/js/pt-BR.js | 146.51 kB | 0% static/js/ru.js | 106.97 kB | 0% static/js/sv.js | 78.2 kB | 0% static/js/th.js | 182.35 kB | 0% static/js/uk.js | 215.11 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/narrow.js | 641.1 kB | 0% static/js/TransactionList.js | 105.97 kB | 0% static/js/wide.js | 163.86 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 11.79 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.86 MB → 5.85 MB (-3.03 kB) | -0.05% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/importers/ynab5.ts` | 📉 -3.03 kB (-10.78%) | 28.13 kB → 25.09 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.C30497Fh.js | 0 B → 5.85 MB (+5.85 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.CiaHZEop.js | 5.86 MB → 0 B (-5.86 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.39 MB → 4.39 MB (-2.67 kB) | -0.06% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/server/importers/ynab5.ts` | 📉 -2.67 kB (-10.63%) | 25.14 kB → 22.47 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.39 MB → 4.39 MB (-2.67 kB) | -0.06% **Unchanged** No assets were unchanged </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-18 08:43:07 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#32714