-
-
Notifications
You must be signed in to change notification settings - Fork 768
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
test(1882): add test case #1905
Conversation
* add test case provided in sinonjs#1882 * change some eslint config to match test: ** class definitions are not enabled in ecmaVersion 5, ** addint Proxy as global See: sinonjs#1882, sinonjs/samsam#37
Pull Request Test Coverage Report for Build 2676
💛 - Coveralls |
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.
Thank you fro your pull request.
I have a few comments related to using ES5.1 instead of ES6.
.eslintrc.yml
Outdated
|
||
plugins: | ||
- ie11 | ||
- local-rules | ||
|
||
parserOptions: |
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.
Sinon is an ES5.1 project, as described in CONTRIBUTING.md.
If we allow ES6 syntax, we drop support for IE11 and older Safari. I don't think we're quite there yet.
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.
Ok, Change this to fit the example. I will revert
test/issues/issues-test.js
Outdated
|
||
describe("#1882", function () { | ||
it("should use constructor name when checking deepEquality", function () { | ||
class ClassWithoutProps {} |
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.
class
is an ES6 convenience over using prototype
. This means that you can achieve the same using prototype
.
function ClassWithoutProps(){}
ClassWithoutProps.prototype.constructor = ClassWithoutProps;
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.
Ahhh, yeah let me change this...
test/issues/issues-test.js
Outdated
it("should use constructor name when checking deepEquality", function () { | ||
class ClassWithoutProps {} | ||
const arg1 = new ClassWithoutProps(); //arg1.constructor.name === ClassWithoutProps | ||
const arg2 = new Proxy({}, {}); //arg2.constructor.name === Object |
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.
Can this test be done without using Proxy
, which is from ES6 and is not supported in IE11?
Perhaps create AnotherClassWithoutProps
?
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's true I will rewrite with to your suggestion, which makes the most sense I think
Thanks for all your suggestions, and sorry for ignoring the ES5 restriction for IE11. I keep learning. |
* Rewert config to support IE11 again * Adopt changes to test to be ES5
Thank you 👍 |
WebWorker test crashed on Node 10 for some unknown reason after merge to |
This test started failing on IE 11 in our Sauce Labs suite last Friday after merge. It was "hidden" from view due to the webworker test also failing on Circle CI@Node 10 (for some unknown reason I am trying to look into).
|
I found more information on this and detailed this out in this comment sinonjs/samsam#41 (comment). It seems like samsam already failed 4 tests when running in IE11 (not known to us) before merging sinonjs/samsam#38. That didn't matter much, as it seems we did not rely on those parts of But the change to constructor equality broke 3 additional tests on IE 11, and this did break things in Sinon 😿 Would you like to have a go at trying to get them passing, @mgred? I can supply you with Sauce Labs credentials (mail in profile). |
I used Turns out no @mroderick Suggestions for fix? They are deeply equal, but maybe it's ok to assume that all errors are thrown? Then I could simply replace |
@fatso83 puh that escalated quickly, Sorry guys. Sure, I will have a look and see what I can find out. |
@mgred you absolutely don't have to, and it's our own fault that we didn't run these tests on our supported browsers to begin with. It's hard to know you are breaking compatibility with some semi-ancient browser when no-one tells you :-) As already stated, 4 tests were already failing on IE11 prior to this, so we should try to tackle them before you look at the new ones, in case they're related. I'll file an issue. |
Where does |
@mroderick I made it up. I guess "with createError() which does a try/catch/return." should be "with a sort of |
ps. suggest we continue any discussion in sinonjs/samsam#42 |
@fatso83 let me see what I can find out |
* test(1882): add test case * add test case provided in sinonjs#1882 * change some eslint config to match test: ** class definitions are not enabled in ecmaVersion 5, ** addint Proxy as global See: sinonjs#1882, sinonjs/samsam#37 * fix(1882): changes according to review * Rewert config to support IE11 again * Adopt changes to test to be ES5
Purpose (TL;DR) - mandatory
See: #1882, sinonjs/samsam#37
Background (Problem in detail) - optional
** class definitions are not enabled in ecmaVersion 5,
** addint Proxy as global
Solution - optional
This test is passing for me locally
How to verify - mandatory
npm install
npm run test-node
Checklist for author
npm run lint
passes