Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/plugins/expressions/common/execution/execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,18 @@ describe('Execution', () => {
});

test('execution state is "pending" while execution is in progress', async () => {
jest.useFakeTimers();
const execution = createExecution('sleep 20');
execution.start(null);
await new Promise(r => setTimeout(r, 5));
jest.advanceTimersByTime(5);
expect(execution.state.get().state).toBe('pending');
jest.useRealTimers();
});

test('execution state is "result" when execution successfully completes', async () => {
const execution = createExecution('sleep 1');
execution.start(null);
await new Promise(r => setTimeout(r, 30));
await execution.result;
expect(execution.state.get().state).toBe('result');
});

Expand Down