Skip to content

Fix build issue caused by misnamed test file - #830

Merged
liam-lloyd merged 1 commit into
mainfrom
noissue_fix_build
Aug 5, 2026
Merged

Fix build issue caused by misnamed test file#830
liam-lloyd merged 1 commit into
mainfrom
noissue_fix_build

Conversation

@liam-lloyd

@liam-lloyd liam-lloyd commented Aug 5, 2026

Copy link
Copy Markdown
Member

Presently, builds are broken because the utils_test.ts file in
api/src/folder/controller imports a function from the
utilities in the /api/test directory. As a result tsc gets confused
regarding what the root folder of the API package is, causing it to
output in an unexpected place. This causes the Dockerfile to be unable
to find the index.js needed to start the API server. This commit fixes
this problem by moving the utilities from utils_test.ts to the test
files that rely on them. This causes some duplication, but

  1. I don't see an elegant way to get tsc to ignore a controller-specific
    test utils file without vitest becoming convinced that there's a test
    file with no tests in it (which it sees as an error)
  2. The utils in utils_test.ts were for loading an clearing fixture data.
    It is probably best not to reuse functions for this across test
    modules, because these are expensive operations in terms of time and
    reusing them encourages us to load more data than a particular module
    might need.

Presently, builds are broken because the utils_test.ts file in
api/src/folder/controller imports a function from the
utilities in the /api/test directory. As a result tsc gets confused
regarding what the root folder of the API package is, causing it to
output in an unexpected place. This causes the Dockerfile to be unable
to find the index.js needed to start the API server. This commit fixes
this problem by moving the utilities from utils_test.ts to the test
files that rely on them. This causes some duplication, but
1. I don't see an elegant way to get tsc to ignore a controller-specific
   test utils file without vitest becoming convinced that there's a test
   file with no tests in it (which it sees as an error)
2. The utils in utils_test.ts were for loading an clearing fixture data.
   It is probably best not to reuse functions for this across test
   modules, because these are expensive operations in terms of time and
   reusing them encourages us to load more data than a particular module
   might need.
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.48%. Comparing base (64a2cc2) to head (91a2a3f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #830      +/-   ##
==========================================
- Coverage   98.48%   98.48%   -0.01%     
==========================================
  Files          93       92       -1     
  Lines        2570     2566       -4     
  Branches      483      483              
==========================================
- Hits         2531     2527       -4     
  Misses         39       39              
Flag Coverage Δ
api 98.48% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a TypeScript build/rootDir issue in @stela/api by removing a misnamed helper file (utils_test.ts) under src/ that imported from the workspace test/ utilities, and by inlining the needed fixture/setup helpers into the specific *.test.ts files that use them.

Changes:

  • Deleted packages/api/src/folder/controller/utils_test.ts to prevent it from being treated as part of the package’s compiled source output.
  • Moved the loadFixtures/clearDatabase helpers into each affected folder controller test file and imported runFixtures directly there.
  • Updated tests to no longer import helpers from ./utils_test.js.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/api/src/folder/controller/utils_test.ts Removed misnamed test utility module that was contributing to the build/rootDir confusion.
packages/api/src/folder/controller/patch_folder.test.ts Inlined fixture loading + DB truncation helpers; removed import of utils_test.
packages/api/src/folder/controller/get_folders_page.test.ts Inlined fixture loading + DB truncation helpers; removed import of utils_test.
packages/api/src/folder/controller/get_folder_share_links.test.ts Inlined fixture loading + DB truncation helpers; removed import of utils_test.
packages/api/src/folder/controller/get_folder_legacy.test.ts Inlined fixture loading + DB truncation helpers; removed import of utils_test.
packages/api/src/folder/controller/get_folder_children.test.ts Inlined fixture loading + DB truncation helpers; removed import of utils_test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@liam-lloyd
liam-lloyd merged commit f65491c into main Aug 5, 2026
153 of 157 checks passed
@liam-lloyd
liam-lloyd deleted the noissue_fix_build branch August 5, 2026 15:51
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.

3 participants