-
Notifications
You must be signed in to change notification settings - Fork 27.4k
test(support): verify support tests results in all tested browsers #16008
Conversation
f6d970a
to
6916651
Compare
test/ng/supportSpec.js
Outdated
@@ -0,0 +1,91 @@ | |||
'use strict'; |
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 would expect this file to be in test/helpers/
. Why here? It is confusing.
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.
Why in test/helpers
? test/helpers/
contains helpers for tests, not actual tests.
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.
It contains helpers for tests and their tests (when they exist) 😃
For lack of a better directory, keeping the spec file next to the source is better than putting it into an arbitrary directory 😛
test/ng/supportSpec.js
Outdated
// Support: iOS 8 only | ||
if (/iPhone OS 10_1\d(?:_\d+)? /.test(userAgent)) { | ||
// iOS 8 official simulators have broken user agent (containing something like `iPhone OS 10_12_5`, | ||
// i.e. the macOS version in place of the iOS version so they'd fall into an incorrect bucket. |
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.
Missing closing )
.
test/ng/supportSpec.js
Outdated
// i.e. the macOS version in place of the iOS version so they'd fall into an incorrect bucket. | ||
// Fix the user agent there. | ||
// NOTE: Make sure the above check doesn't catch the real iOS 10! | ||
userAgent = userAgent.replace(/iPhone OS 10(?:_\d)+/, 'iPhone OS 8_1'); |
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.
_\d
--> _\d+
test/ng/supportSpec.js
Outdated
userAgent = userAgent.replace(/iPhone OS 10(?:_\d)+/, 'iPhone OS 8_1'); | ||
} | ||
|
||
if (/edge\//i.test(userAgent)) { |
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.
Why not convert userAgent
to lowercase once and avoid all the i
flags? 😃
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.
That would have to be lowerCasedUserAgent
to be precise. And maybe we'll need case sensitivity one day?
test/ng/supportSpec.js
Outdated
fatArrows: true, | ||
shorthandMethods: true | ||
}; | ||
} else if (/(?:msie|trident)/i.test(userAgent)) { |
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.
/(?:msie|trident)/
--> /msie|trident/
test/ng/supportSpec.js
Outdated
fatArrows: true, | ||
shorthandMethods: true | ||
}; | ||
} else if (/\b9\.\d+(\.\d+)* safari/i.test(userAgent)) { |
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.
/\b9\.\d+(\.\d+)*
--> /\b9(?:\.\d+)+
test/ng/supportSpec.js
Outdated
fatArrows: false, | ||
shorthandMethods: true | ||
}; | ||
} else if (/\b\d+\.\d+(\.\d+)* safari/i.test(userAgent)) { |
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.
/\b\d+\.\d+(\.\d+)*
--> /\b\d+(?:\.\d+)+
test/ng/supportSpec.js
Outdated
fatArrows: true, | ||
shorthandMethods: true | ||
}; | ||
} else if (/android 4\.[0-3]/i.test(userAgent)) { |
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.
This will break when Android 4.10 is out 😛
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.
Android 4.x is dead, we're safe. :)
2ba18e0
to
492cb35
Compare
@gkalpak PR updated, tests now pass. |
Why did tests previously fail? |
492cb35
to
de30421
Compare
The spec file moved (I missed The tests were failing as I didn't add results for Safari 8 so it was treated the same as Safari 10. :-) |
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
New tests.
What is the current behavior? (You can also link to an open issue here)
It's not tested whether browsers pass or fail specific support tests used to skip particular test blocks.
What is the new behavior (if this is a feature change)?
All browsers have verified support tests results.
Does this PR introduce a breaking change?
No.
Please check if the PR fulfills these requirements
Docs have been added / updated (for bug fixes / features)Other information: