-
Notifications
You must be signed in to change notification settings - Fork 353
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(persister): Add disableSortingHarEntries
option
#321
Conversation
When disabled, entries in the the final HAR will be sorted by the request's timestamp. This is done by default to satisfy the HAR 1.2 spec but can be enabled to improve diff readability when committing recordings to git.
expect(har).to.be.an('object'); | ||
expect(har.log.entries).to.have.lengthOf(4); | ||
expect(har.log.entries[0].request.url).to.include(orderedRecordUrl(3)); | ||
expect(har.log.entries[1].request.url).to.include(orderedRecordUrl(4)); |
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.
Due to the way we are adding entries, we add new ones to the beginning of the array and then keep only the unique ones (due to how _.uniqWith
works), new entries will be at the top of the file instead of at the bottom.
@@ -241,6 +241,25 @@ polly.configure({ | |||
}); | |||
``` | |||
|
|||
### disableSortingHarEntries |
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.
Let me know if you have a better name for this option @jasonmit
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.
I think this is a good name for the option 👍
FWIW, the description of this option doesn't make sense...
If I'm setting |
@tlands you're right. I think the description is wrong. When disabled, it will not be sorted by timestamp. |
Description
When disabled, entries in the the final HAR will be sorted by the request's timestamp.
This is done by default to satisfy the HAR 1.2 spec but can be enabled to improve
diff readability when committing recordings to git.
Motivation and Context
Related to #269.
Types of Changes
Checklist