-
Notifications
You must be signed in to change notification settings - Fork 108
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
requiring lolex prints a warning #232
Comments
I'll take a look at this. |
@shdq thanks, a quick fix would be not to shim |
Also for the detection: instead of |
In general, should updating the default shimmed functions be considered a breaking change? So don't shim new stuff by default, then for new majors activate everything? |
Good idea @SimenB , this is the second time I can recall it's breaking stuff. |
Some console things, for example ava's default reporter, start to break a little if there are any console logs or warnings during operation, and because each ava node process ends up logging a new warning, the output gets rather messy because of this issue. I've turned off node warnings with |
@SneakyMax A pending PR #233 exists. Until this PR is merged, if you want to only hide the warning printed by Lolex, you can use // Those two lines must be run before `require('lolex')` is first called
const logProcessErrors = require('log-process-errors')
logProcessErrors({
level: {
warning({ message }) {
if (message.includes('queueMicrotask() is experimental')) {
return 'silent'
}
}
}
}) |
Fixed by #233. |
Removes the queueMicrotask() warning if you don't use it. refs #1985
Removes the queueMicrotask() warning if you don't use it. refs sinonjs#1985
require('lolex')
prints the following warning:3.1.0
11.9.0
, Ubuntu18.10
What did you expect to happen?
There should be no warnings printed on the console when
queueMicrotask()
is not used by the calling code. This could for example be done by wrappingtimers.queueMicrotask()
so thatglobal.queueMicrotask
is only accessed whentimers.queueMicrotask()
is called.Experimental warnings can be turned off with
--no-warnings
but this is inconvenient as it removes other potentially useful warnings.Why suppressing this warning matters: some users (like me) might have precise expectations on what's printed on the console, if console output is being parsed, for example for logging purpose. Also some users might see this warning and without additional context think it was triggered from their code, making them debug a non-issue.
What actually happens
There is a warning printed on console.
How to reproduce
See above.
The text was updated successfully, but these errors were encountered: