test(desktop): fix ambient failing electron/vitest suites (extensionless TS imports) - #62398
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating the direct-Node TypeScript import issue. The premise is present on current main: apps/desktop/package.json:40 runs .ts tests through node --test, while apps/desktop/electron/zoom.test.ts:10 and its siblings use extensionless relative imports.
Problems
apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsxremoves regression coverage unrelated to the test-runner repair: multiline slash dispatch, draft restoration, memory-graph aliases, selected-session resume, and timeout recovery. Those behaviors remain implemented insubmit.ts:217-247andsubmit.ts:289-309; please preserve their tests rather than simplifying the Harness by dropping those cases.
Suggested changes
- Restore the removed cases and keep the Harness inputs needed to exercise them. The
.tsimport changes andrewriteRelativeImportExtensionsconfiguration can be salvaged independently.
Automated hermes-sweeper review.
| @@ -54,30 +55,22 @@ function Harness({ | |||
| busyRef, | |||
There was a problem hiding this comment.
Please retain the Harness inputs instead of deleting the selected-session, timeout-recovery, slash-payload, and memory-graph regression cases. Current production code still relies on the selected-session resume path (submit.ts:217-247) and timeout retry path (submit.ts:289-309); neither is related to the extensionless-import repair.
0a02a4c to
bdf95bd
Compare
The electron node:test suites failed with ERR_MODULE_NOT_FOUND on extensionless relative TS imports (`from './zoom'`); add explicit .ts extensions + rewriteRelativeImportExtensions in tsconfig.electron.json (not allowImportingTsExtensions, which conflicts with composite emit, TS5096). Also fixes jsdom harness setup + packaging-script test drift. node --test: 320 pass / 0 fail on this base.
bdf95bd to
4bb7e3b
Compare
|
Closing — this repairs an ambient suite state the tree is no longer in. The extensionless-TS-import failure mode this targets isn't current: Worth flagging on the record for anyone who finds this later: the branch also removed regression coverage for five behaviors unrelated to the import repair. So it shouldn't be revived wholesale even if extensionless imports break again — that would be a focused PR touching resolution only. |
Problem
The desktop Electron
node --testsuites fail on currentmainwithERR_MODULE_NOT_FOUNDon extensionless relative TypeScript imports (for example,import { … } from './zoom').Fix
.tsextensions to relative imports in Electron sources and tests.rewriteRelativeImportExtensions: trueintsconfig.electron.json(rather thanallowImportingTsExtensions, which conflicts with composite emit under TS5096).Fresh verification after rebasing onto
095b9eed3npm --prefix apps/desktop run test:desktop:platforms→ 320 passed, 1 skipped, 0 failed.npx vitest run --environment jsdom --exclude src/store/panes.test.ts→ 1,229 passed, 0 failed.npm --prefix apps/desktop run typecheck→ passed.src/store/panes.test.ts; the identical test also fails on clean upstream095b9eed3(13 passed, 1 failed), so it is not introduced by this PR.Test/config-only change; no runtime behavior is changed.