fix(sdk): support async function in insomnia.test#8243
Merged
Conversation
ihexxa
marked this pull request as draft
December 12, 2024 11:30
ihexxa
force-pushed
the
fix/sdk/async-test
branch
from
December 17, 2024 07:14
7c88059 to
790d51a
Compare
ihexxa
marked this pull request as ready for review
December 17, 2024 07:48
cwangsmv
self-requested a review
December 20, 2024 02:17
cwangsmv
approved these changes
Dec 20, 2024
cwangsmv
left a comment
Contributor
There was a problem hiding this comment.
LGTM, only a minor issue which could fix in later releases
| function translateTestHandlers(script: string): string { | ||
| const replacedTests = script.replace(/insomnia\.test\(/g, 'await insomnia.test('); | ||
| return replacedTests.replace(/insomnia\.test\.skip\(/g, 'await insomnia.test.skip('); | ||
| } |
Contributor
There was a problem hiding this comment.
A minor issue here:
If user has already input await, it will translate the script to
await await insomnia.test('xxx', () => {})
It's fine for me since double await could execute as expected, maybe we can enhance in the future
ihexxa
enabled auto-merge (squash)
December 23, 2024 03:26
ihexxa
force-pushed
the
fix/sdk/async-test
branch
from
December 23, 2024 03:26
b0f06e1 to
3e9aceb
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Ref: INS-4765