Skip to content

fix: remove orphaned test files that can never sync from scaffold-stark-2 - #20

Merged
tu11aa merged 1 commit into
basefrom
fix/remove-orphaned-test-files
Jul 30, 2026
Merged

fix: remove orphaned test files that can never sync from scaffold-stark-2#20
tu11aa merged 1 commit into
basefrom
fix/remove-orphaned-test-files

Conversation

@tu11aa

@tu11aa tu11aa commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Root cause

sync-basecamp-repo.yaml in scaffold-stark-2 rsyncs into this repo with --exclude='__test*__', added on 2025-05-05 in scaffold-stark-2 commit 985489f (PR #528). In rsync, --exclude both prevents new copies and protects the existing destination copy from --delete. As a result, the 25 test files under packages/nextjs in this repo froze at whatever state they were in as of the last sync before that exclude was added (2025-04-22), and no future sync — no matter what changes upstream — can ever update or remove them.

Later, scaffold-stark-2 commit 6df4565 (2026-03-13) migrated @starknet-react/core@starknet-start/react, changing package.json and every test file that imported the old package together, in the same commit. This repo received the package.json half of that change via sync (it now depends on @starknet-start/react ^1.0.8) but could never receive the test-file half, because the exclude rule was already blocking/protecting those paths. The frozen test files still do import { useConnect } from "@starknet-react/core" — a package that exists in neither repo anymore.

This is why Check typings on Next.js has failed on every one of the last 40 CI runs on this branch: tsc hits TS2307: Cannot find module '@starknet-react/core' (plus a few unrelated type-signature drifts) across 9 of these frozen test files.

The fix

PR #528's intent was clearly that this repo should not carry scaffold-stark-2's unit tests going forward — it stopped future copies, but it never cleaned up the 25 files that were already here before the rule took effect. This PR deletes those files. Once removed, the exclude rule correctly keeps them out permanently, since rsync has no source path left to (not) copy from.

Deleted directories (25 files total):

  • packages/nextjs/hooks/scaffold-stark/__tests__/ (14 test files + 1 in seed/)
  • packages/nextjs/utils/scaffold-stark/__test__/ (6 files)
  • packages/nextjs/app/debug/_components/contract/__test__/ (2 test files + 1 in mock/)
  • packages/nextjs/services/web3/__test__/ (1 file)

No dependency, config, or other source file was changed — this is a deletion-only cleanup.

Risk checked before opening this PR: would deleting all tests break the test-runner step?

Confirmed empirically that it does not:

  • packages/nextjs/package.json's test script is already "vitest run --passWithNoTests" — the --passWithNoTests flag pre-dates this PR, so vitest exits 0 with "No test files found" rather than failing.
  • Searched all of packages/nextjs (excluding node_modules) for any *.test.ts(x) / *.spec.ts(x) files outside the four deleted directories — there are none, so this is not a partial cleanup that leaves a mismatched suite behind.
  • No config changes were made to accommodate this — the safety net already existed.

Verification (run locally against this branch)

  1. yarn install — succeeds (exit 0), before and after the deletion.
  2. yarn check-types (the currently-failing "Check typings on Next.js" step) — before: fails with 25 error TS... across 9 files, all inside the deleted directories. after: exits 0, zero errors.
  3. yarn test — exits 0: No test files found, exiting with code 0 (via pre-existing --passWithNoTests).
  4. yarn lint — exits 0: No ESLint warnings or errors.
  5. Files deleted (git rm -r on 4 directories, 25 files):
    • packages/nextjs/app/debug/_components/contract/__test__/mock/mockABI.ts
    • packages/nextjs/app/debug/_components/contract/__test__/utilsContract.test.tsx
    • packages/nextjs/app/debug/_components/contract/__test__/utilsDisplay.test.tsx
    • packages/nextjs/hooks/scaffold-stark/__tests__/ContractClassHashCache.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/seed/mockDeployedContractData.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useAutoConnect.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useDataTransaction.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useDeployedContractInfo.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useNativeCurrencyPrice.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useOutsideClick.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useScaffoldContract.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useScaffoldEventHistory.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useScaffoldMultiWriteContract.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useScaffoldReadContract.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useScaffoldStarkProfile.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useScaffoldWriteContract.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useTargetNetwork.test.ts
    • packages/nextjs/hooks/scaffold-stark/__tests__/useTransactor.test.ts
    • packages/nextjs/services/web3/__test__/PriceService.test.ts
    • packages/nextjs/utils/scaffold-stark/__test__/common.test.ts
    • packages/nextjs/utils/scaffold-stark/__test__/contract.test.ts
    • packages/nextjs/utils/scaffold-stark/__test__/eventKeyFilter.test.ts
    • packages/nextjs/utils/scaffold-stark/__test__/eventsData.test.ts
    • packages/nextjs/utils/scaffold-stark/__test__/mockDeployedContractAbi.ts
    • packages/nextjs/utils/scaffold-stark/__test__/types.test.ts

This PR is deletion-only and touches nothing else. Not merging — leaving for a basecamp reviewer/maintainer to review and merge.

…rk-2

Deletes 25 test files under packages/nextjs (__tests__/__test__ dirs)
that have been frozen at their 2025-04-22 state and cannot be updated
or removed by any future sync from scaffold-stark-2.
@tu11aa
tu11aa merged commit ddae138 into base Jul 30, 2026
1 check passed
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.

1 participant