-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sdk): support async function in insomnia.test #8243
Conversation
7c88059
to
790d51a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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('); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
b0f06e1
to
3e9aceb
Compare
Changes
Ref: INS-4765