Skip to content

Commit e665139

Browse files
committed
test(deploy): pin that an unrequested lint is never awaited, by behavior
1 parent 3b49719 commit e665139

1 file changed

Lines changed: 20 additions & 10 deletions

File tree

‎apps/sim/lib/workflows/application/workflow-deployments.test.ts‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,26 @@ describe('workflow deployment application use cases', () => {
366366
expect(result.lint).toEqual(unquotedRowJson)
367367
})
368368

369-
it('skips the lint when the surface does not ask for it', async () => {
370-
mocks.buildWorkflowLintReport.mockResolvedValue(unquotedRowJson)
371-
372-
const result = await deployWorkflow.execute({
373-
principal: createSessionPrincipal(),
374-
input: { workflowId: 'workflow-1', requestId: 'request-11' },
375-
})
376-
377-
expect(result).toMatchObject({ success: true, warnings: [], lint: null })
378-
expect(mocks.buildWorkflowLintReport).not.toHaveBeenCalled()
369+
it('neither runs nor waits on a lint the surface does not ask for', async () => {
370+
vi.useFakeTimers()
371+
try {
372+
mocks.buildWorkflowLintReport.mockReturnValue(new Promise(() => {}))
373+
let settled: unknown
374+
void deployWorkflow
375+
.execute({
376+
principal: createSessionPrincipal(),
377+
input: { workflowId: 'workflow-1', requestId: 'request-11' },
378+
})
379+
.then((result) => {
380+
settled = result
381+
})
382+
383+
await vi.advanceTimersByTimeAsync(0)
384+
385+
expect(settled).toMatchObject({ success: true, warnings: [], lint: null })
386+
} finally {
387+
vi.useRealTimers()
388+
}
379389
})
380390

381391
it('never fails or blocks a deploy when lint cannot run', async () => {

0 commit comments

Comments
 (0)