vitest icon indicating copy to clipboard operation
vitest copied to clipboard

feat(vitest,ui): allow run individual tests/suites from the UI

Open userquin opened this issue 1 year ago • 0 comments

Description

We need this PR https://github.com/vitest-dev/vitest/pull/6405

Since we don't have the full tree in the state (missing parent in task), the client will send the task id, the children ids and all parent ids: parent ids are required to avoid mark the test not being run as skipped and so their state will not change.

We also need to reset configOverride.testNamePattern when re-running some file (including all files), otherwise we can only re-run previous test/suite run, maybe we can have some side effect here (I need to do some additional tests).

[!CAUTION] Right now the command line will skip other tests/suites not matching the pattern (using t + regexp): the problem with the UI is about enabling/disabling re-run button, disabled when test/suite without state or state with skip or todo value (check command line filter behaviour screenshot below)

[!WARNING] We should add the test "path" when filtering tests/suites (check filtering from command line screenshot below)

resolves #6638

filtering from command line

imagen

command line filter behaviour

imagen

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • [x] It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • [ ] Ideally, include a test that fails without this PR but passes with it.
  • [x] Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • [x] Run the tests with pnpm test:ci.

Documentation

  • [ ] If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • [x] Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

userquin avatar Oct 04 '24 15:10 userquin