Skip to content
Source
Sign inSign up
TanStack/intent

fix: make Windows unit and integration test suites pass under test:pr #342

MergedLadyBluenotes(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/342/headmerged by LadyBluenotes(GitHub profile, opens in a new tab)

🎯 Changes

  • In withNativeCompiler (packages/intent/src/validate/blocks.ts), typescript/unstable/async's Client.connectViaSpawn spawns tsgo without a cwd option (inheriting the parent's process.cwd()) while passing --cwd <root> on the command line, and api.close() closes stdin without waiting for the child process to exit. Temporarily switching process.cwd() to dirname(root) across the initial api.updateSnapshot call keeps tsgo from holding an OS directory handle on root on Windows so callers can rmSync(root) immediately after api.close().
  • In packages/intent/vitest.config.ts, set GIT_CEILING_DIRECTORIES to tmpdir() (so non-git temp fixtures do not walk up into an ancestor .git directory during git apply), TERM: 'xterm-256color' (so @clack/prompts enables Unicode symbols before module-load evaluation on Windows), and prepend C:\Program Files\Git\bin to PATH when present on Windows (so bash resolves to Git Bash rather than WSL C:\Windows\System32\bash.exe).
  • In reusable-workflows.test.ts and review-workflow.test.ts, join PATH entries with path.delimiter, use #!/usr/bin/env node instead of #!${process.execPath} (which contains spaces and backslashes on Windows), and pass pathToFileURL(preload).href to node --import.
  • In tests/integration/scaffold.ts, spawn process.execPath with node_modules/verdaccio/bin/verdaccio directly instead of cmd.exe /c verdaccio (shell: true) so registry.stop() terminates the Verdaccio Node process directly and awaits 'close' before removing storageDir. Raise beforeAll timeout in load-integration.test.ts and scanner-integration.test.ts to 60_000 ms to match the test cases, and use execSync for npm pack in packed-release.test.ts.
  • Adds a patch changeset.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr (run pnpm build:all first).

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).
    1. 🦋 Changeset detected

      Latest commit: d882106be6bd20c71b6ad2f3c105ceb4f5ad42f3

      The changes in this PR will be included in the next version bump.

      This PR includes changesets to release 1 package
      NameType
      @tanstack/intentPatch

      Not sure what this means? Click here to learn what changesets are.

      Click here if you're a maintainer who wants to add another changeset to this PR

    2. Review in Change Stack →

      Note

      Currently processing new changes in this PR. This may take a few minutes, please wait...

      ⚙️ Run configuration
      • Configuration used: defaults
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: be950b40-d7ae-4dae-8be9-b1d4ac9fd339
      📥 Commits

      Reviewing files that changed from the base of the PR and between 1ff7b0f87a1c4db006eed10742e56cc60b517c1a and bfd25ea0236b2d8fe368ff8c3978797a7a838b59.

      📒 Files selected for processing: 9
      • .changeset/windows-tsgo-close-wait.md
      • packages/intent/src/validate/blocks.ts
      • packages/intent/tests/integration/load-integration.test.ts
      • packages/intent/tests/integration/packed-release.test.ts
      • packages/intent/tests/integration/scaffold.ts
      • packages/intent/tests/integration/scanner-integration.test.ts
      • packages/intent/tests/reusable-workflows.test.ts
      • packages/intent/tests/review-workflow.test.ts
      • packages/intent/vitest.config.ts
      +------------------------------------------+
      | Your favorite GPT-wrapped code reviewer. |
      +------------------------------------------+
        \
         \     /)/)
              ( '')
              /  |
            o(___)
      ✨ Finishing Touches
      📝 Generate docstrings
      • Commit to this branch
      • Create a new PR
      🧪 Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    3. View your CI Pipeline Execution ↗ for commit bfd25ea0236b2d8fe368ff8c3978797a7a838b59

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded1m 2sView ↗
      nx run-many --targets=build✅ Succeeded1sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-10-19 01:16:23 UTC

    4. Open in StackBlitz

      npm i https://pkg.pr.new/@tanstack/intent@342

      commit: bfd25ea

    5. Merging this PR will not alter performance

      :warning: 7 benchmarks spent significant time in system calls

      System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

      Measurement and system calls

      :information_source: 7 benchmarks have no flame graph

      The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

      ✅ 12 untouched benchmarks


      Comparing fix/windows-test-pr (d882106) with main (1ff7b0f) Open in CodSpeed

Sign in to join this conversation.