Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Typecheck the remaining type-level test assertions (#5162)

Nick Gomezbd0d9194ac3c
diff --git a/packages/app/tests/meta/syncscope-caller-coverage.test.ts b/packages/app/tests/meta/syncscope-caller-coverage.test.ts
index 3c0ad29d8..052718233 100644
--- a/packages/app/tests/meta/syncscope-caller-coverage.test.ts
+++ b/packages/app/tests/meta/syncscope-caller-coverage.test.ts
@@ -19,7 +19,9 @@ function listProductionTsFiles(dir: string): string[] {
st.isFile() &&
(entry.endsWith('.ts') || entry.endsWith('.tsx')) &&
!entry.endsWith('.test.ts') &&
- !entry.endsWith('.test.tsx')
+ !entry.endsWith('.test.tsx') &&
+ !entry.endsWith('.test-helper.ts') &&
+ !entry.endsWith('.type-tests.ts')
) {
out.push(full);
}
diff --git a/packages/core/src/schemas/api/_envelope.test.ts b/packages/core/src/schemas/api/_envelope.test.ts
index b74584809..4ad678fee 100644
--- a/packages/core/src/schemas/api/_envelope.test.ts
+++ b/packages/core/src/schemas/api/_envelope.test.ts
@@ -305,10 +305,7 @@ describe('UploadAssetSuccessSchema', () => {
test('does NOT contain ok:true wrapper field (D22 success drops wrapper)', () => {
const result = UploadAssetSuccessSchema.safeParse({ src: 'foo.png' });
expect(result.success).toBe(true);
- if (result.success) {
- // @ts-expect-error -- ok is not a field on UploadAssetSuccess
- void result.data.ok;
- }
+ expect(UploadAssetSuccessSchema.shape).not.toHaveProperty('ok');
});
test('fails when src is missing', () => {
diff --git a/packages/server/src/comments/thread-store.type-tests.ts b/packages/server/src/comments/thread-store.type-tests.ts
new file mode 100644
index 000000000..3202926d1
--- /dev/null
+++ b/packages/server/src/comments/thread-store.type-tests.ts
@@ -0,0 +1,5 @@
+import type { CommentThreadPatch } from './types.ts';
+
+// @ts-expect-error createdBy is deliberately outside CommentThreadPatch
+const _identityPatch: CommentThreadPatch = { createdBy: 'principal-someone-else' };
+void _identityPatch;
diff --git a/packages/server/src/content-filter.test.ts b/packages/server/src/content-filter.test.ts
index 1e49d968b..5b9c794e5 100644
--- a/packages/server/src/content-filter.test.ts
+++ b/packages/server/src/content-filter.test.ts
@@ -20,19 +20,6 @@ import {
} from './content-filter.ts';
import { installTestLoggers, loggerFactory } from './logger.ts';
-type ExclusionReadOpts = NonNullable<Parameters<ContentFilter['isExcluded']>[1]>;
-type PathReadOpts = NonNullable<Parameters<ContentFilter['isPathIgnored']>[1]>;
-
-// @ts-expect-error — sync admission and Show All Files are mutually exclusive.
-const _combinedSyncAndBypass: ExclusionReadOpts = {
- bypassFilters: true,
- syncScope: { pathBase: 'project' },
-};
-// @ts-expect-error — asset serving never accepts the sync-only capability.
-const _syncScopedAssetServe: PathReadOpts = { syncScope: { pathBase: 'project' } };
-void _combinedSyncAndBypass;
-void _syncScopedAssetServe;
-
describe('ContentFilter', () => {
let projectDir: string;
let xdgDir: string;
diff --git a/packages/server/src/content-filter.type-tests.ts b/packages/server/src/content-filter.type-tests.ts
new file mode 100644
index 000000000..168252367
--- /dev/null
+++ b/packages/server/src/content-filter.type-tests.ts
@@ -0,0 +1,14 @@
+import type { ContentFilter } from './content-filter.ts';
+
+type ExclusionReadOpts = NonNullable<Parameters<ContentFilter['isExcluded']>[1]>;
+type PathReadOpts = NonNullable<Parameters<ContentFilter['isPathIgnored']>[1]>;
+
+const _combinedSyncAndBypass: ExclusionReadOpts = {
+ bypassFilters: true,
+ // @ts-expect-error — sync admission and Show All Files are mutually exclusive.
+ syncScope: { pathBase: 'project' },
+};
+// @ts-expect-error — asset serving never accepts the sync-only capability.
+const _syncScopedAssetServe: PathReadOpts = { syncScope: { pathBase: 'project' } };
+void _combinedSyncAndBypass;
+void _syncScopedAssetServe;