Skip to content

ci: typecheck tests and install with npm ci - #6

Merged
Asdivyansh merged 1 commit into
SilosLabs:mainfrom
TheDreamSaver:ci/npm-ci-cache-typecheck-tests
Oct 31, 2026
Merged

Asdivyansh merged 1 commit into
SilosLabs:mainfrom
TheDreamSaver:ci/npm-ci-cache-typecheck-tests

Conversation

@TheDreamSaver

Copy link
Copy Markdown
Member

Fixes #5

What

  • tsconfig.test.json (new): extends tsconfig.json, adds tests/** and vitest.config.ts, and sets noEmit.
  • npm run typecheck now runs tsc --noEmit && tsc -p tsconfig.test.json. CONTRIBUTING.md, prepublishOnly and CI all call typecheck, so tests are checked everywhere without a new command.
  • Test fixtures: added the fields SiloConfigSchema requires (proxy.autoOpenLogs, sandbox.image, integrations), using their schema defaults, so test behaviour doesn't change.
  • Unused imports and parameters: removed, and the (f, i) filter callbacks renamed to (_, i).
  • onboard.test.ts: the inquirer.prompt mock now uses vi.mocked(...), matching tests/proxy/server.test.ts, instead of an unsafe cast.
  • CI: npm install → npm ci, plus cache: npm on actions/setup-node.

Testing

  • npm ci && npm run typecheck: exit 0 (source and tests).
  • npm test: 23 files, 339 tests pass.
  • npm run build: succeeds.
  • Checked that the new step actually fails when it should: a temporary test file with a ProxyConfig fixture missing autoOpenLogs makes npm run typecheck fail with TS2741, and removing it makes typecheck pass again.

Tests were never typechecked because tsconfig.json excludes tests/, so
24 type errors had accumulated, including fixtures missing fields that
SiloConfigSchema now requires.

Add tsconfig.test.json and make `npm run typecheck` check it too, fix
the errors (fixture fields take their schema defaults), and switch CI
to `npm ci` with the setup-node npm cache.

Fixes SilosLabs#5
@Asdivyansh
Asdivyansh merged commit 0bbfb52 into SilosLabs:main Oct 31, 2026
2 checks 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.

CI doesn't typecheck tests (24 hidden errors) and uses npm install instead of npm ci

2 participants