Committing http client test files to Git
已回答
I really like using the built in HTTP client to test rest endpoints. Ideally I would like to add those tests to my project and commit them to version control (Git), however every time I run the tests, the file is modified with a line like
<> 2022-10-11T135406.242.json
Which is useful to review the request and result, but adds noise to the file. When I create commits in Git, it makes things messy with a record of every test run.
I am aware of
// @no-log
However, that disables the logging entirely. I still would like to have the logs available to review. I just don't want to have to contend with commiting the logs to version control. Is there a way to do this?
请先登录再写评论。
According to the documentation, this happens only for scratch file requests, otherwise the http files are not modified:
> If the request was executed from a scratch file, the link to its response output is also added below the original request
Make sure you are running requests from the standalone file in a project, not from a scratch file.