Closed kprimerakis closed 4 years ago
I tried. Thing is, I don't know how to test for this. Tests do include console
and I couldn't get them to fail.
In the tests, the console
variable isn't resolved, in my example it is. So I can't get the tests to fail because the resolved
condition in line 15 fails. I have no idea why this happens.
This test for no-state-access
throws an exception on master:
Date.now();
I imagine console
works differently for some reason.
Looks like it is different for console
and Date
:
notice that the reference for console
has resolved: null
, but Date
doesn't.
Yep, date fails in the tests.
We only have regression tests currently. Do we need a unit test for utils? I was just going to add a Date
variable in one of the existing regression tests, we happy with that?
Simple fix for bug. I saw the following error when linting a file that included builtin variables (
Date
,console
etc). Fixed by checking that the definition exists before accessing node in thefindDefinition
function.