From cb12ca08ca043835b0d62478ae2bb6a1d58e7cc8 Mon Sep 17 00:00:00 2001 From: ssw Date: Thu, 16 Jul 2026 16:51:01 +0800 Subject: [PATCH] ci(dacli): enable vitest typecheck + narrow tests/scripts glob --- tsconfig.test-core.json | 8 ++++++++ vitest.config.ts | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tsconfig.test-core.json diff --git a/tsconfig.test-core.json b/tsconfig.test-core.json new file mode 100644 index 0000000..36e8d4a --- /dev/null +++ b/tsconfig.test-core.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": true, + "skipLibCheck": true + }, + "include": ["src/core/help.ts", "tests/core/**/*.spec.ts"] +} \ No newline at end of file diff --git a/vitest.config.ts b/vitest.config.ts index 967d18f..17b537f 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -10,11 +10,19 @@ export default defineConfig({ 'tests/integration/**/*.spec.ts', 'tests/core/**/*.spec.ts', 'tests/commands/**/*.spec.ts', - 'tests/scripts/**/*', + 'tests/scripts/**/*.spec.ts', ], exclude: ['node_modules', 'tests/e2e/**'], testTimeout: 60_000, pool: 'forks', poolOptions: { forks: { singleFork: true } }, + typecheck: { + enabled: true, + // Narrow scope: only typecheck the DacliHelp interface test. + // Uses isolated tsconfig (tsconfig.test-core.json) to avoid + // surfacing 46 pre-existing type errors in src/commands/*. + include: ['tests/core/**/*.spec.ts'], + tsconfig: './tsconfig.test-core.json', + }, }, })