-
Notifications
You must be signed in to change notification settings - Fork 27.3k
test(errorHandlingConfig): add test for errorHandlingConfig() to be i… #15770
Conversation
21522fe to
b80da97
Compare
…ndependent of minErr Closes angular#15770
test/AngularSpec.js
Outdated
| expect(errorHandlingConfig().objectMaxDepth).toBe(5); | ||
| }); | ||
|
|
||
| it('should set objectMaxDepthx', function() { |
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.
objectMaxDepthx --> objectMaxDepth
test/AngularSpec.js
Outdated
|
|
||
| it('should set objectMaxDepthx', function() { | ||
| errorHandlingConfig({objectMaxDepth: 3}); | ||
| expect(errorHandlingConfig()).toEqual({objectMaxDepth: 3}); |
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.
To make this test more robust, use expect(errorHandlingConfig().objectMaxDepth).toBe(3).
So, if we introduce more properties in the future, it won't break.
test/AngularSpec.js
Outdated
| expect(errorHandlingConfig().objectMaxDepth).toBe(originalObjectMaxDepthInErrorMessage); | ||
| }); | ||
|
|
||
| they('should set objectMaxDepth to NAN when $prop is supplied', |
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.
Nit: NAN --> Nan 😁
b80da97 to
ed6269a
Compare
…ndependent of minErr Closes angular#15770
|
@gkalpak |
gkalpak
left a comment
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.
One minor nit. LGTM otherwise 😃
test/AngularSpec.js
Outdated
| expect(errorHandlingConfig().objectMaxDepth).toBe(originalObjectMaxDepthInErrorMessage); | ||
| }); | ||
|
|
||
| they('should set objectMaxDepth to Nan when $prop is supplied', |
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 just realized I accidentally wrote Nan in my previous comment. I meant NaN 😁
ed6269a to
eab5ec0
Compare
|
@gkalpak |
…ndependent of minErr Closes angular#15770
…ependent of `minErr`) Closes #15770
…ependent of `minErr`) Closes angular#15770
…ndependent of minErr
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
test
What is the current behavior? (You can also link to an open issue here)
There is no test for errorHandlingConfig
What is the new behavior (if this is a feature change)?
Add tests to errorHandlingConfig independent of minErr tests
Does this PR introduce a breaking change?
no
Please check if the PR fulfills these requirements
Other information:
These tests was added in #15707 , but it looks like there are some problems in the PR, so i have added the missing tests in this PR.