-
Notifications
You must be signed in to change notification settings - Fork 829
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
add tests for several packages #1024
add tests for several packages #1024
Conversation
76bc6e6
to
bb3436a
Compare
lint errors can be fixed via |
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.
There is a lot of excellent work that I didn't comment on because then you'd have to "resolve" the comment. Very very excellent work!
A few standardization comments. I really wish we could keep you locked up after all this stuff ends because you just saved me so much time haha!
What was your dev setup btw? I need to write a contributing / developing doc soon. I usually have 4 terminal windows running:
and an empty one to run whatever command like |
I have my pixel book at the min so had to fiddle with the setup a bit to get Chrome to launch (I installed puppeteer and set CHROME_BIN to its executable path). But other than that, I have been running a build and test manually:
i didn't realise a watch script was already set up as I wasn't running the commands much. I'd use that just the way you've said now that I know And before committing, I'd run format and lint (though clearly I forgot in my last push 😂) |
6aba529
to
854037e
Compare
0ebcabd
to
fdcdf64
Compare
FYI @e111077 i dropped sinon but kept their timers package (as you can use it standalone) for mocking setTimeout. but it turns out their build isn't a valid ES module even though its in the |
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.
REALLY excellent work, again
export const waitForEvent = (el: Element, ev: string) => new Promise((res) => { | ||
el.addEventListener(ev, () => { | ||
res(); | ||
}, {once: true}); |
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.
also surprised this is compiled out correctly by es-dev-server
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.
brilliant, brilliant, brilliant, absolutely brilliant work!
Approving, but I just want some clarification on the sinon part
migrating internally to run google-wide tests |
here you are. i added sinon to the one test, ill do a new pr once my sinon one gets merged (which reminds me i need to go finish it...) |
LGTM. Need to make some build changes internally to make this work. Requesting a code freeze on this PR in the meanwhile. Thanks! |
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.
Heya, sorry to double back. I think for the sake of getting this submitted can you please remove sinon fake timers? The internal build system does not like it and cannot actually find SinonFakeTimers. It seems for some reason sinon types never actually resolve in our tests and just use the untyped js file.
Thanks! |
@e111077 thats too bad. though it doesn't surprise me, their 'browser bundle' is a little hacked together i'd say... i just deleted sinon to solve it. i think we should still make sure we introduce a utility function at least for mocking timers, but this can probably do for now. |
can you please file an issue asking for the timers helper so we make sure it doesn't slip through the cracks |
had to make a few IE-specific changes. Have to figure out why IE tests aren't running externally. Copybara service will forward these changes when it is merged internally. It usually closes this PR as well. If it doesn't it should still carry your authored commits into master. |
self-isolation lead to me writing some tests for you.
if they need changing any way just let me know.
cc @e111077
I'll fix the lint error tomorrow, failing ci atm