-
Notifications
You must be signed in to change notification settings - Fork 27
chore: introduce vitest as testing tool #1704
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
chore: introduce vitest as testing tool #1704
Conversation
const nameRegexp = new RegExp(`example_input_one${intervalBase}0`, 'i'); | ||
// wait for the first row to be rendered | ||
const row = await screen.findByRole('row', { name: nameRegexp }); |
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.
Can we extract this logic into some common function?
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.
I thought about it but in the end not sure if it make sense.
As if we make it common, then it it needs to be something like
const waitForRow = async (rowName: string | RegExp) => {
return screen.findByRole('row', { name: rowName });
};
which is one liner that seems to not improve visibility of the code 🤷 wdyt?
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.
ohh sorry, commented on different line.
I mean to say, if we can extract logic for this regexp smtg like this:
const rowNameRegex = (interval: number) => new RegExp(`${inputName}${intervalBase}${interval}`, 'i');
NIT: it is declared at only two place, so we can skip it as well, whatever you choose works for me.
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.
that one make sense, but modified a bit differently, let me know wdyt.
0fd36d7
to
6b39912
Compare
334827c
to
31c3b74
Compare
d380089
to
69499ce
Compare
69499ce
to
548534a
Compare
57a6926
to
15632d0
Compare
Issue number:
PR Type
What kind of change does this PR introduce?
Summary
Changes
vitest as testing framework
adapting tests to vitest
dependant on PR vite as building tool.
User experience
N/A, should remain the same
Checklist
If an item doesn't apply to your changes, leave it unchecked.
Review
Tests
See the testing doc.
Demo/meeting:
Reviewers are encouraged to request meetings or demos if any part of the change is unclear