Skip to content
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

Don't throw if hypothesisConfig() isn't a function #428

Merged

Conversation

seanh
Copy link
Contributor

@seanh seanh commented Jun 7, 2017

Log a warning, rather than throwing an error, if
window.hypothesisConfig() exists but isn't a function.

"Warn but continue" is in line with our general approach to handling
invalid configuration in the client. For example if there's an invalid
js-hypothesis-config script in the page it logs a warning and continues.

For some required config settings, such as config.app, if the setting is
invalid then the client crashes out immediately because it can't
continue. But otherwise it should warn and continue.

Log a warning, rather than throwing an error, if
window.hypothesisConfig() exists but isn't a function.

"Warn but continue" is in line with our general approach to handling
invalid configuration in the client. For example if there's an invalid
js-hypothesis-config script in the page it logs a warning and continues.

For some required config settings, such as config.app, if the setting is
invalid then the client crashes out immediately because it can't
continue. But otherwise it should warn and continue.
@codecov-io
Copy link

codecov-io commented Jun 7, 2017

Codecov Report

Merging #428 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #428      +/-   ##
==========================================
+ Coverage   89.72%   89.72%   +<.01%     
==========================================
  Files         124      124              
  Lines        4955     4956       +1     
  Branches      855      855              
==========================================
+ Hits         4446     4447       +1     
  Misses        509      509
Impacted Files Coverage Δ
src/annotator/config/settings.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a99b84...1376ebb. Read the comment docs.

Copy link
Member

@robertknight robertknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@robertknight robertknight merged commit ec3d3f6 into master Jun 8, 2017
@robertknight robertknight deleted the dont-throw-if-hypothesisConfig-isnt-a-function branch June 8, 2017 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants