Skip to content

Commit 6333f66

Browse files
committed
fix the tests that were hanging, remove a log that was no longer useful, increase the timelimit to the typescript-compile test(it was failing because of the time limit) and limit the number of workers per thread(because it was saturating the computer without much of a speedup)
1 parent 9734add commit 6333f66

6 files changed

Lines changed: 6 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"dist:win": "npm run build && electron-builder --win nsis",
1919
"preview": "vite preview",
2020
"lint": "eslint . --max-warnings 0",
21-
"test": "vitest run",
21+
"test": "vitest run --pool 2",
2222
"test:smoke": "npm run build && vitest run tests/electron-smoke.test.ts"
2323
},
2424
"dependencies": {

src/features/project-editor/pane/rich-markdown-editor/rich-markdown-editor.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import { normalizeEditorDocumentValue } from './rich-markdown-editor-value-sync'
1313
import { createTramaTurndownService, TurndownServiceFlags } from '../../../../shared/turndown-service-factory'
1414
import { useEditorZoom } from './use-editor-zoom'
1515

16+
const DEFAULT_ZOOM_REF: EditorZoomRef = { current: 1.0 }
17+
1618
interface RichMarkdownEditorProps {
1719
documentId: string | null
1820
value: string
@@ -156,7 +158,7 @@ export function RichMarkdownEditor(props: RichMarkdownEditorProps) {
156158
useRichEditorLifecycle(lifecycleParams)
157159
useSyncToolbarControls({ documentId, hostRef, editorRef, saveDisabled, saveLabel, onSaveNow, revertDisabled, revertLabel, onRevertNow, syncState, syncStateLabel })
158160
useFocusModeScopeEffect(editorRef, hostRef, focusModeEnabled, focusScope, isActive)
159-
useEditorZoom({ editorRef, hostRef, zoomRef: zoomRef ?? { current: 1.0 }, triggerTagOverlayRender })
161+
useEditorZoom({ editorRef, hostRef, zoomRef: zoomRef ?? DEFAULT_ZOOM_REF, triggerTagOverlayRender })
160162

161163
// Sync the serialization ref into the parent-provided prop ref.
162164
// Because registerEditorTextChangeHandler mutates serializationRef.current.flush

src/features/project-editor/pane/rich-markdown-editor/use-editor-zoom.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ interface UseEditorZoomParams {
1111

1212
export function useEditorZoom({ editorRef, hostRef, zoomRef, triggerTagOverlayRender }: UseEditorZoomParams): void {
1313
useEffect(() => {
14-
console.log('Applying editor zoom:', zoomRef.current);
1514
const zoomLevel = zoomRef.current
1615

1716
const host = hostRef.current

src/features/project-editor/use-project-editor-shortcuts-effect.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ export function useProjectEditorShortcutsEffect({
5050
}
5151
const isCommandKey = (event.ctrlKey || event.metaKey);
5252

53-
if (isCommandKey) {
54-
console.log('Key pressed with command key:', event.key, event.code);
55-
}
56-
5753
if (isCommandKey && !event.altKey && event.code === 'Period') {
5854
event.preventDefault()
5955
onToggleSplitLayout()

src/features/project-editor/use-project-editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export function useProjectEditor(): ProjectEditorModel {
147147

148148
useEffect(() => {
149149
zoomRef.current = layoutState.workspaceLayout.zoomLevel ?? 1.0
150-
}, [layoutState.workspaceLayout.zoomLevel, zoomRef])
150+
}, [layoutState.workspaceLayout.zoomLevel])
151151

152152
useProjectEditorEffects(uiState, projectState, documentState, layoutState, setters, actions, core, autoPickProjectFolderOnStart, paneWorkspace)
153153

tests/typescript-compile.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ describe('TypeScript compilation for test files', () => {
1818
result.status,
1919
output || 'TypeScript exited with a non-zero status without diagnostic output.',
2020
).toBe(0)
21-
}, 20000)
21+
}, 60000)
2222
})

0 commit comments

Comments
 (0)