chore(test): move vitest cache to node_modules/.cache#616
Merged
John-David Dalton (jdalton) merged 1 commit intomainfrom Apr 24, 2026
Merged
chore(test): move vitest cache to node_modules/.cache#616John-David Dalton (jdalton) merged 1 commit intomainfrom
John-David Dalton (jdalton) merged 1 commit intomainfrom
Conversation
`pnpm install` already clears `node_modules/` (and its `.cache/`
subdir) automatically, so pinning vitest's cacheDir there gives
us free cache invalidation on every install without needing a
dedicated clean step. Matches the pattern applied in
../socket-packageurl-js and ../meander.
Applied to both vitest configs (main + isolated).
Dropped `**/.cache` from .gitignore — nothing writes to a
top-level `.cache/` anymore; remaining cache consumers all land
under node_modules.
Also fixes test/unit/utils.test.mts's resolveAbsPaths assertion
to match on the path suffix (`/package.json`, `/src/index.ts`)
rather than the repo-dir name. Previous form ("socket-sdk-js/
package.json") broke when the test ran from a git worktree
whose working-tree path didn't match the primary checkout's dir
name. Suffix assertions are worktree-robust without losing the
"path-was-resolved-to-absolute" signal.
James Tu (jmsjtu)
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cacheDirmoves from./.cache/vitestto./node_modules/.cache/vitestin both the main and isolated configs.pnpm installalready wipesnode_modules/(and its.cache/subdir), so this buys us free cache invalidation on every install — no dedicated clean step needed.../socket-packageurl-jsand../meander.**/.cachefrom.gitignoresince nothing writes to a top-level.cache/anymore.Adjacent fix:
test/unit/utils.test.mts'sresolveAbsPathsassertion matched on"socket-sdk-js/package.json", which breaks when the test runs from a git worktree whose directory name doesn't match the primary checkout. Switched to suffix matching (/package.json$,/src/index.ts$) which still verifies the path was resolved to absolute without baking in the repo's directory name. Caught while running the full suite from asocket-sdk-js-cache/worktree.Test plan
pnpm exec vitest --config .config/vitest.config.mts --run→ 565/565 passing.pnpm run build→ clean.