fix-integration-alias-resolution: Stabilize Vitest integration alias resolution #2

Open
std-bot wants to merge 1 commit from task/fix-integration-alias-resolution into main
First-time contributor

Assigned idea

Make the @ alias in vitest.integration.config.ts resolve to an absolute path so integration tests work reliably regardless of the current working directory, and add a small integration test that proves the alias works.

Approach: 1) Update vitest.integration.config.ts to use an absolute alias target (e.g., path.resolve(__dirname, 'src')) instead of './src'.
2) (Optional but recommended) Set root: __dirname in the config to further reduce CWD sensitivity.
3) Add a tiny probe module src/__aliasProbe.ts exporting a constant.
4) Add an integration test src/alias-resolution.integration.test.ts that imports the probe via @/__aliasProbe and asserts the value.

Verification: Run:

  • npx vitest --config vitest.integration.config.ts --run
  • cd src && npx vitest --config ../vitest.integration.config.ts --run
    Both runs should pass, and src/alias-resolution.integration.test.ts should successfully import @/__aliasProbe.

Risk: Low. Changes are isolated to the Vitest integration config and add-only test/probe files; the main risk is if the repo’s tooling expects relative aliasing for some reason or uses a different module resolution strategy.

Agent context

Task slug: fix-integration-alias-resolution
Branch: task/fix-integration-alias-resolution

## Assigned idea Make the `@` alias in `vitest.integration.config.ts` resolve to an absolute path so integration tests work reliably regardless of the current working directory, and add a small integration test that proves the alias works. Approach: 1) Update `vitest.integration.config.ts` to use an absolute alias target (e.g., `path.resolve(__dirname, 'src')`) instead of `'./src'`. 2) (Optional but recommended) Set `root: __dirname` in the config to further reduce CWD sensitivity. 3) Add a tiny probe module `src/__aliasProbe.ts` exporting a constant. 4) Add an integration test `src/alias-resolution.integration.test.ts` that imports the probe via `@/__aliasProbe` and asserts the value. Verification: Run: - `npx vitest --config vitest.integration.config.ts --run` - `cd src && npx vitest --config ../vitest.integration.config.ts --run` Both runs should pass, and `src/alias-resolution.integration.test.ts` should successfully import `@/__aliasProbe`. Risk: Low. Changes are isolated to the Vitest integration config and add-only test/probe files; the main risk is if the repo’s tooling expects relative aliasing for some reason or uses a different module resolution strategy. ## Agent context Task slug: fix-integration-alias-resolution Branch: task/fix-integration-alias-resolution <!-- std-ts:idea-pr-body -->
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin task/fix-integration-alias-resolution:task/fix-integration-alias-resolution
git switch task/fix-integration-alias-resolution

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff task/fix-integration-alias-resolution
git switch task/fix-integration-alias-resolution
git rebase main
git switch main
git merge --ff-only task/fix-integration-alias-resolution
git switch task/fix-integration-alias-resolution
git rebase main
git switch main
git merge --no-ff task/fix-integration-alias-resolution
git switch main
git merge --squash task/fix-integration-alias-resolution
git switch main
git merge --ff-only task/fix-integration-alias-resolution
git switch main
git merge task/fix-integration-alias-resolution
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
snorkel/root-repository-maintenance-8ac8ec1620d541!2
No description provided.