Skip to content
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

feat(vitest): add onTestsRerun method to global setup context #6803

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Oct 28, 2024

Description

Fixes #6417

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

  • 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.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • 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

  • 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:.

Copy link

netlify bot commented Oct 28, 2024

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 510e64a
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/672a02efaecc9f00081fb05e
😎 Deploy Preview https://deploy-preview-6803--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sheremet-va sheremet-va marked this pull request as ready for review October 28, 2024 14:54
@sheremet-va sheremet-va added this to the 2.2.0 milestone Oct 28, 2024
AriPerkkio
AriPerkkio previously approved these changes Oct 29, 2024
Copy link
Member

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I like this idea! 💯

I wonder if at some point we'll have "plugins" that are registered in the global setup for more hooks. We'll see where this API lands eventually 🤔

Copy link

pkg-pr-new bot commented Nov 4, 2024

@vitest/browser

pnpm add https://pkg.pr.new/@vitest/browser@6803

@vitest/coverage-istanbul

pnpm add https://pkg.pr.new/@vitest/coverage-istanbul@6803

@vitest/expect

pnpm add https://pkg.pr.new/@vitest/expect@6803

@vitest/coverage-v8

pnpm add https://pkg.pr.new/@vitest/coverage-v8@6803

@vitest/mocker

pnpm add https://pkg.pr.new/@vitest/mocker@6803

@vitest/pretty-format

pnpm add https://pkg.pr.new/@vitest/pretty-format@6803

@vitest/runner

pnpm add https://pkg.pr.new/@vitest/runner@6803

@vitest/snapshot

pnpm add https://pkg.pr.new/@vitest/snapshot@6803

@vitest/spy

pnpm add https://pkg.pr.new/@vitest/spy@6803

@vitest/ui

pnpm add https://pkg.pr.new/@vitest/ui@6803

@vitest/utils

pnpm add https://pkg.pr.new/@vitest/utils@6803

vite-node

pnpm add https://pkg.pr.new/vite-node@6803

vitest

pnpm add https://pkg.pr.new/vitest@6803

@vitest/web-worker

pnpm add https://pkg.pr.new/@vitest/web-worker@6803

@vitest/ws-client

pnpm add https://pkg.pr.new/@vitest/ws-client@6803

commit: 510e64a

hi-ogawa
hi-ogawa previously approved these changes Nov 4, 2024
Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this to make arktype/attest's global setup rerun-able https://github.com/hi-ogawa/reproductions/tree/main/vitest-attest-snapshot It looks working nicely 👏

@sheremet-va sheremet-va dismissed stale reviews from hi-ogawa and AriPerkkio via 510e64a November 5, 2024 11:35
@sheremet-va sheremet-va changed the title feat(vitest): add onWatcherRerun method to global setup context feat(vitest): add onTestsRerun method to global setup context Nov 5, 2024
@sheremet-va sheremet-va merged commit e26e066 into vitest-dev:main Nov 13, 2024
17 of 18 checks passed
@sheremet-va sheremet-va deleted the feat/onwatcher-rerun branch November 13, 2024 16:01
@sheremet-va sheremet-va modified the milestones: 2.2.0, 3.0.0 Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding custom watch commands
3 participants