-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not do partial retries in test runs (#811)
## Problem Postman actions cannot be re-tested when a partial success happened in the last test step. ## Solution Prevent partial retries in test runs.
- Loading branch information
1 parent
69de54c
commit db01e24
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -463,6 +463,7 @@ describe('send transactional email', () => { | |
recipient: recipients, | ||
}, | ||
}) | ||
$.execution.testRun = false | ||
await expect(sendTransactionalEmail.run($)).resolves.not.toThrow() | ||
expect($.http.post).toBeCalledTimes(4) | ||
expect($.setActionItem).toHaveBeenCalledWith({ | ||
|
@@ -476,4 +477,42 @@ describe('send transactional email', () => { | |
}, | ||
}) | ||
}) | ||
|
||
it('should send to all recipients in test runs', async () => { | ||
const recipients = [ | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
] | ||
$.step.parameters.destinationEmail = recipients.join(',') | ||
$.getLastExecutionStep = vi.fn().mockResolvedValueOnce({ | ||
status: 'success', | ||
errorDetails: 'error error', | ||
dataOut: { | ||
status: [ | ||
'BLACKLISTED', | ||
'ACCEPTED', | ||
'INTERMITTENT-ERROR', | ||
'ERROR', | ||
'RATE-LIMITED', | ||
], | ||
recipient: recipients, | ||
}, | ||
}) | ||
$.execution.testRun = true | ||
await expect(sendTransactionalEmail.run($)).resolves.not.toThrow() | ||
expect($.http.post).toBeCalledTimes(5) | ||
expect($.setActionItem).toHaveBeenCalledWith({ | ||
raw: { | ||
status: ['ACCEPTED', 'ACCEPTED', 'ACCEPTED', 'ACCEPTED', 'ACCEPTED'], | ||
recipient: recipients, | ||
subject: 'test subject', | ||
body: 'test body', | ||
from: 'jack', | ||
reply_to: '[email protected]', | ||
}, | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters