Skip to content

Tests: make image-engine-choice and image-mask-from-text typecheck - #14272

Merged
danielhanchen merged 1 commit into
mainfrom
fix/frontend-test-typecheck
Oct 19, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/frontend-test-typecheck

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Frontend build + bundle sanity fails its Typecheck step (npm run typecheck, tests included) on PRs based on current main (seen on #14245):

tests/image-engine-choice.test.ts(305,48): error TS2339: Property 'baseRepo' does not exist on type '{ repoId: string; kind?: ...; filename?: ...; } | { repoId: string; kind: "gguf"; filename: string; displayRepoId?: string; baseRepo?: string; }'.
tests/image-mask-from-text.test.ts(246,30): error TS2345: Argument of type '"drawImage"' is not assignable to parameter of type 'never'.
tests/image-mask-from-text.test.ts(246,61): error TS2345: Argument of type '"putImageData"' is not assignable to parameter of type 'never'.

Reproduced on main 6c159816c5 with node scripts/typecheck.mjs --tests (TypeScript 7.0.2, as CI). The product code typechecks. Both errors are in tests:

Change

Test-only:

  • image-engine-choice.test.ts: nativeReloadTarget<{ repoId: string; baseRepo?: string }>(null, gguf)?.baseRepo. This names T, so the status-built branch, the one that carries baseRepo, is what is read. The assertion is unchanged.
  • image-mask-from-text.test.ts: assert.equal(calls.length, 0) in place of assert.deepEqual(calls, []). It asserts the same thing without the narrowing, with a comment saying why.

Testing

  • node scripts/typecheck.mjs --tests: clean (exit 0), from the three errors above on main.
  • node --experimental-strip-types --test on both files: 30 passed.

npm run typecheck (tests included) fails on main:
- image-engine-choice.test.ts reads .baseRepo off nativeReloadTarget(null, ...),
  whose T then has no baseRepo; name T so the status-built branch is typed.
- image-mask-from-text.test.ts: assert.deepEqual(calls, []) from strict
  assert narrows calls to never[], so the later includes() calls fail to
  typecheck; compare the length instead.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T15:31:46.234921Z bc06eb4 Manual request
🔒 Security Review ⚠️ Failed 2026-10-19T15:26:37.380447Z bc06eb4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: bc06eb4e21

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit bf22118 into main Oct 19, 2026
@danielhanchen
danielhanchen deleted the fix/frontend-test-typecheck branch October 19, 2026 15:37
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