-
Notifications
You must be signed in to change notification settings - Fork 1.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
[core-http] fix browser tests on Firefox #9091
[core-http] fix browser tests on Firefox #9091
Conversation
Issue 1) on Firefox user agent string contains more than two fields: "core-http/1.1.3 OS/WindowsNT 10.0; Win64; x64" while on Chrome it has just two: "core-http/1.1.3 OS/Win32" Changed to verify it has at least two fields. Issue 2) Most likely either Chrome has a bug, or behavior of dates before January 1, 1970 is not well defined. For the date Tue, Jan 1 0001 00:00:00 GMT, Chrome sets the year to be 2001, while Firefox keeps the year as 0001. Changed to use another date in the test. Issue 3) The error message when parsing xml with an input of undefined or null is different between Chrome and Firefox. Changed to pass on either one.
@@ -286,9 +286,9 @@ describe("msrest", function() { | |||
required: false, | |||
serializedName: "DateTimeRfc1123" | |||
}; | |||
const rfc = new Date("Mon, 01 Jan 0001 00:00:00 GMT"); | |||
const rfc = new Date("Thu, 01 Jan 3001 00:00:00 GMT"); |
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.
bizarre to me that we're worried about times thousands of years from the present
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.
yeah, I will update to some date in 2020
error.message.indexOf("Document is empty"), | ||
-1, | ||
`error.message ("${error.message}") should have contained "Document is empty"` | ||
assert.ok( |
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.
is it worth checking this message? Should we just assert that it throws?
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 wanted to keep the old behavior of verifying that it's a parsing error.
Issue 1) on Firefox user agent string contains more than two
fields:
"core-http/1.1.3 OS/WindowsNT 10.0; Win64; x64"
while on Chrome it has just two:
"core-http/1.1.3 OS/Win32"
Changed to verify it has at least two fields.
Issue 2) Most likely either Chrome has a bug, or behavior of dates
before January 1, 1970 is not well defined. For the date Tue, Jan 1
0001 00:00:00 GMT, Chrome sets the year to be 2001, while Firefox
keeps the year as 0001.
Changed to use another date in the test.
Issue 3) The error message when parsing xml with an input of undefined
or null is different between Chrome and Firefox.
Changed to pass on either one.