Skip to content

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

Merged
merged 21 commits into from
May 12, 2025

Conversation

soleksy-splunk
Copy link
Contributor

@soleksy-splunk soleksy-splunk commented Apr 22, 2025

Issue number:

PR Type

What kind of change does this PR introduce?

  • Feature
  • Bug Fix
  • Refactoring (no functional or API changes)
  • Documentation Update
  • Maintenance (dependency updates, CI, etc.)

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

  • self-review - I have performed a self-review of this change according to the development guidelines
  • Changes are documented. The documentation is understandable, examples work (more info)
  • PR title and description follows the contributing principles
  • meeting - I have scheduled a meeting or recorded a demo to explain these changes (if there is a video, put a link below and in the ticket)

Tests

See the testing doc.

  • Unit - tests have been added/modified to cover the changes
  • Smoke - tests have been added/modified to cover the changes
  • UI - tests have been added/modified to cover the changes
  • coverage - I have checked the code coverage of my changes (see more)

Demo/meeting:

Reviewers are encouraged to request meetings or demos if any part of the change is unclear

@soleksy-splunk soleksy-splunk changed the base branch from develop to chore/introduce-vite-as-build-tool April 22, 2025 17:42
Comment on lines 55 to 46
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 });
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@soleksy-splunk soleksy-splunk force-pushed the chore/introduce-vite-as-build-tool branch 2 times, most recently from 0fd36d7 to 6b39912 Compare May 5, 2025 17:56
@soleksy-splunk soleksy-splunk force-pushed the chore/introduce-vitest-as-testing-tool branch 2 times, most recently from 334827c to 31c3b74 Compare May 8, 2025 18:01
Base automatically changed from chore/introduce-vite-as-build-tool to develop May 9, 2025 08:50
@soleksy-splunk soleksy-splunk force-pushed the chore/introduce-vitest-as-testing-tool branch 2 times, most recently from d380089 to 69499ce Compare May 9, 2025 13:44
@soleksy-splunk soleksy-splunk force-pushed the chore/introduce-vitest-as-testing-tool branch from 69499ce to 548534a Compare May 9, 2025 13:47
@soleksy-splunk soleksy-splunk force-pushed the chore/introduce-vitest-as-testing-tool branch from 57a6926 to 15632d0 Compare May 9, 2025 16:08
@soleksy-splunk soleksy-splunk marked this pull request as ready for review May 10, 2025 12:14
@soleksy-splunk soleksy-splunk requested a review from a team as a code owner May 10, 2025 12:14
@soleksy-splunk soleksy-splunk merged commit ae9dc0e into develop May 12, 2025
93 checks passed
@soleksy-splunk soleksy-splunk deleted the chore/introduce-vitest-as-testing-tool branch May 12, 2025 11:16
@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants