-
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
feat: add more snippets for the post-request scripting #7395
Merged
Conversation
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
ihexxa
changed the title
feat: add more snippets for the post-request scripting
feat: add more snippets for the post-request scripting - INS-3823
May 13, 2024
ihexxa
changed the title
feat: add more snippets for the post-request scripting - INS-3823
feat: add more snippets for the post-request scripting
May 13, 2024
gatzjames
reviewed
May 13, 2024
const getStatusCode = 'const statusCode = insomnia.response.code;'; | ||
const getStatusMsg = 'const status = insomnia.response.status;'; | ||
const getRespTime = 'const responseTime = insomnia.response.responseTime;'; | ||
const getJsonBody = 'const jsonBody = insomnia.response.json();'; |
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.
Are these sync functions or should we await them?
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.
Thanks for pointing it out, I verified that they are sync functions.
CurryYangxx
approved these changes
May 14, 2024
ihexxa
added a commit
that referenced
this pull request
May 15, 2024
…#7329) * feat: integrate post-request script to the engine * refactor: some minor improvements * fix: lint error * chore: clean up typings * refactor: separate transforming into sync and async parts * use named args * fix: renaming pre-req vars, functions and 2 minor fixes * fix: the error message is updated * feat: add snippets for post-request scripting (#7395) * feat: enable extended assertion chains on `insomnia.response` (#7396) * feat: add snippets for post-request scripting * feat(sdk): support response.to.have assertion for verifying response * chore: fix lint error --------- Co-authored-by: jackkav <jackkav@gmail.com>
ihexxa
added a commit
that referenced
this pull request
May 15, 2024
…#7329) * feat: integrate post-request script to the engine * refactor: some minor improvements * fix: lint error * chore: clean up typings * refactor: separate transforming into sync and async parts * use named args * fix: renaming pre-req vars, functions and 2 minor fixes * fix: the error message is updated * feat: add snippets for post-request scripting (#7395) * feat: enable extended assertion chains on `insomnia.response` (#7396) * feat: add snippets for post-request scripting * feat(sdk): support response.to.have assertion for verifying response * chore: fix lint error --------- Co-authored-by: jackkav <jackkav@gmail.com>
ihexxa
added a commit
that referenced
this pull request
May 20, 2024
…#7329) * feat: integrate post-request script to the engine * refactor: some minor improvements * fix: lint error * chore: clean up typings * refactor: separate transforming into sync and async parts * use named args * fix: renaming pre-req vars, functions and 2 minor fixes * fix: the error message is updated * feat: add snippets for post-request scripting (#7395) * feat: enable extended assertion chains on `insomnia.response` (#7396) * feat: add snippets for post-request scripting * feat(sdk): support response.to.have assertion for verifying response * chore: fix lint error --------- Co-authored-by: jackkav <jackkav@gmail.com>
ihexxa
added a commit
that referenced
this pull request
May 22, 2024
…#7329) * feat: integrate post-request script to the engine * refactor: some minor improvements * fix: lint error * chore: clean up typings * refactor: separate transforming into sync and async parts * use named args * fix: renaming pre-req vars, functions and 2 minor fixes * fix: the error message is updated * feat: add snippets for post-request scripting (#7395) * feat: enable extended assertion chains on `insomnia.response` (#7396) * feat: add snippets for post-request scripting * feat(sdk): support response.to.have assertion for verifying response * chore: fix lint error --------- Co-authored-by: jackkav <jackkav@gmail.com>
jackkav
added a commit
that referenced
this pull request
May 22, 2024
…#7329) * feat: integrate post-request script to the engine * refactor: some minor improvements * fix: lint error * chore: clean up typings * refactor: separate transforming into sync and async parts * use named args * fix: renaming pre-req vars, functions and 2 minor fixes * fix: the error message is updated * feat: add snippets for post-request scripting (#7395) * feat: enable extended assertion chains on `insomnia.response` (#7396) * feat: add snippets for post-request scripting * feat(sdk): support response.to.have assertion for verifying response * chore: fix lint error --------- Co-authored-by: jackkav <jackkav@gmail.com>
ihexxa
added a commit
that referenced
this pull request
May 23, 2024
* feat: update data model and request-pane to support post-req-script * fix: unit test failed * feat: integrate post-request script to the engine - INS-3785,INS-3786 (#7329) * feat: integrate post-request script to the engine * refactor: some minor improvements * fix: lint error * chore: clean up typings * refactor: separate transforming into sync and async parts * use named args * fix: renaming pre-req vars, functions and 2 minor fixes * fix: the error message is updated * feat: add snippets for post-request scripting (#7395) * feat: enable extended assertion chains on `insomnia.response` (#7396) * feat: add snippets for post-request scripting * feat(sdk): support response.to.have assertion for verifying response * chore: fix lint error --------- Co-authored-by: jackkav <jackkav@gmail.com> * test: add tests for post-request scripts and post-request scripts - INS-3786 (#7331) * test: add some tests for post-req script and script engine * fix: incorrect script type * chore: refresh package-lock after merging * chore: clean up package-lock.json * fix: failed tests after rebasing * feat: support importing post-req script from Postman (#7423) * feat: support importing post-req script from Postman * fix: introduce post-req script property for merged changes * test: add a test case for importing scripts * fix: add missing fixture * chore: remove row after merging * chore: rename to after-response-script * fix test * refresh lock * update snapshot * extract pre request logic to function * refresh lock again * throw on base env * fix: revert the logic which rejects the case of unselected environment --------- Co-authored-by: jackkav <jackkav@gmail.com>
stefancruz
pushed a commit
to stefancruz/insomnia
that referenced
this pull request
Jun 30, 2024
* feat: update data model and request-pane to support post-req-script * fix: unit test failed * feat: integrate post-request script to the engine - INS-3785,INS-3786 (Kong#7329) * feat: integrate post-request script to the engine * refactor: some minor improvements * fix: lint error * chore: clean up typings * refactor: separate transforming into sync and async parts * use named args * fix: renaming pre-req vars, functions and 2 minor fixes * fix: the error message is updated * feat: add snippets for post-request scripting (Kong#7395) * feat: enable extended assertion chains on `insomnia.response` (Kong#7396) * feat: add snippets for post-request scripting * feat(sdk): support response.to.have assertion for verifying response * chore: fix lint error --------- Co-authored-by: jackkav <jackkav@gmail.com> * test: add tests for post-request scripts and post-request scripts - INS-3786 (Kong#7331) * test: add some tests for post-req script and script engine * fix: incorrect script type * chore: refresh package-lock after merging * chore: clean up package-lock.json * fix: failed tests after rebasing * feat: support importing post-req script from Postman (Kong#7423) * feat: support importing post-req script from Postman * fix: introduce post-req script property for merged changes * test: add a test case for importing scripts * fix: add missing fixture * chore: remove row after merging * chore: rename to after-response-script * fix test * refresh lock * update snapshot * extract pre request logic to function * refresh lock again * throw on base env * fix: revert the logic which rejects the case of unselected environment --------- Co-authored-by: jackkav <jackkav@gmail.com>
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.
Ref: INS-3823
Changes: