Skip to content

Commit 5e71e57

Browse files
committed
test: drop assertions that cannot fail
Four tests asserted nothing about the code under test: - app/api/copilot/methods/route.test.ts was the directory's only file — it asserted expect(true).toBe(true) against a route that does not exist. - tools/index.test.ts carried a block self-documented as existing "to maintain test count". - mcp/storage/memory-cache.test.ts closed a delete-a-missing-key case with expect(true).toBe(true); it now asserts the call resolves without throwing. - realtime/src/index.test.ts checked typeof roomManager.x === 'function' and typeof process.on === 'function', both of which tsc already proves. Removing the realtime cases leaves a real gap: index.ts registers uncaughtException, unhandledRejection, SIGINT and SIGTERM handlers with no coverage. Better to have that gap visible than papered over by a test that would pass with the handlers deleted.
1 parent f4692ec commit 5e71e57

4 files changed

Lines changed: 1 addition & 32 deletions

File tree

‎apps/realtime/src/index.test.ts‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -320,24 +320,9 @@ describe('Socket Server Index Integration', () => {
320320
expect(getWorkflowState).toBeTypeOf('function')
321321
expect(WorkflowOperationSchema).toBeDefined()
322322
})
323-
324-
it.concurrent('should maintain all original functionality after refactoring', async () => {
325-
expect(httpServer).toBeDefined()
326-
expect(io).toBeDefined()
327-
expect(roomManager).toBeDefined()
328-
329-
expect(typeof roomManager.addUserToRoom).toBe('function')
330-
expect(typeof roomManager.removeUserFromRoom).toBe('function')
331-
expect(typeof roomManager.removeSocketFromAllRooms).toBe('function')
332-
expect(typeof roomManager.broadcastPresenceUpdate).toBe('function')
333-
})
334323
})
335324

336325
describe('Error Handling', () => {
337-
it('should have global error handlers configured', () => {
338-
expect(typeof process.on).toBe('function')
339-
})
340-
341326
it('should handle server setup', () => {
342327
expect(httpServer).toBeDefined()
343328
expect(io).toBeDefined()

‎apps/sim/app/api/copilot/methods/route.test.ts‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎apps/sim/lib/mcp/storage/memory-cache.test.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,7 @@ describe('MemoryMcpCache', () => {
142142
})
143143

144144
it('does not throw for non-existent key', async () => {
145-
// Should complete without throwing
146-
await cache.delete('non-existent')
147-
// If we get here, it worked
148-
expect(true).toBe(true)
145+
await expect(cache.delete('non-existent')).resolves.not.toThrow()
149146
})
150147

151148
it('does not affect other entries', async () => {

‎apps/sim/tools/index.test.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3623,12 +3623,6 @@ describe('Automatic Internal Route Detection', () => {
36233623
Object.assign(tools, originalTools)
36243624
})
36253625

3626-
it('PLACEHOLDER - external routes are called directly', async () => {
3627-
// Placeholder test to maintain test count - external URLs now go direct
3628-
// No proxy is used for external URLs anymore - they use secureFetchWithPinnedIP
3629-
expect(true).toBe(true)
3630-
})
3631-
36323626
it('should call external URLs directly with SSRF protection', async () => {
36333627
// External URLs now use secureFetchWithPinnedIP which uses Node's http/https modules
36343628
// This test verifies the proxy is NOT called for external URLs

0 commit comments

Comments
 (0)