-
Notifications
You must be signed in to change notification settings - Fork 17
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
Prevent console.error from going off because it causes some problems in test code #85
Conversation
I may have merged #79 prematurely. When running tests on develop, I saw that 0 out of 0 tests passed, which counts as success :/ This PR now fixes that and additionally updates the lints to apply to the |
I actually think jest is pointing us to a valid criticism of holochain-conductor-api. I don't think libraries should log things, and they should definitely not log errors under expected and normal circumstances. If we're looking for the proper solution here, I propose that we propagate this error properly. Perhaps a good solution would be to capture this error but not print it, and then edit the error path of
|
So the problem is really that we can't hide the error in the browser, see https://stackoverflow.com/questions/12915582/eliminate-404-url-error-in-console and verlok/vanilla-lazyload#460. When we do the What we could do is do the fetch in the first Would you be okey if I did that change? The thing you are running into is that Jest is not really a browser environment, so it shouldn't even do the fetch, but Jest tries to simulate a browser so we have thing like window set. Jest is weird... |
I could imagine wanting to test launcher autodetection using jest. maybe the best approach would be to revert to before this PR but just put the |
I will test out this version as requested. |
For example, this CI run fails to due to some
getFileName
error which I think is caused by the usage ofconsole.error