Skip to content

Conversation

@hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Feb 15, 2025

Description

Currently hooks are registered through a public API getCurrentSuite().on and exposed by getHooks, so I need to inject a magic property to hook function itself, so we can pass it to cleanup function.

For timeout error stack support, we'll probably also need to inject stackTraceError from #7502 in a similar way.

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

@netlify
Copy link

netlify bot commented Feb 15, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 405178b
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/67b0635f0c57db0008582f92
😎 Deploy Preview https://deploy-preview-7500--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.

@hi-ogawa hi-ogawa marked this pull request as ready for review February 16, 2025 03:31
@sheremet-va sheremet-va merged commit 0c2924b into vitest-dev:main Mar 3, 2025
13 checks passed
@hi-ogawa hi-ogawa deleted the fix-before-hook-cleanup-function-timeout branch March 4, 2025 00:45
jelmore1674 pushed a commit to jelmore1674/build-changelog that referenced this pull request Mar 19, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/main/packages/coverage-v8#readme) ([source](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8)) | devDependencies | patch | [`3.0.7` -> `3.0.8`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-v8/3.0.7/3.0.8) |
| [vitest](https://github.com/vitest-dev/vitest) ([source](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | devDependencies | patch | [`3.0.7` -> `3.0.8`](https://renovatebot.com/diffs/npm/vitest/3.0.7/3.0.8) |

---

### Release Notes

<details>
<summary>vitest-dev/vitest (@&#8203;vitest/coverage-v8)</summary>

### [`v3.0.8`](https://github.com/vitest-dev/vitest/releases/tag/v3.0.8)

[Compare Source](vitest-dev/vitest@v3.0.7...v3.0.8)

#####    🐞 Bug Fixes

-   Fix fetch cache multiple writes  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7546 [<samp>(1a8b4)</samp>](vitest-dev/vitest@1a8b4337)
-   Use browser.isolate instead of config.isolate  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7560 [<samp>(4b5ed)</samp>](vitest-dev/vitest@4b5ed902)
-   Remove vestigial spy stub, import directly from `@vitest/spy`  -  by [@&#8203;mrginglymus](https://github.com/mrginglymus) in vitest-dev/vitest#7575 [<samp>(7f7ff)</samp>](vitest-dev/vitest@7f7ff11c)
-   Correctly split the argv string  -  by [@&#8203;btea](https://github.com/btea) in vitest-dev/vitest#7533 [<samp>(4325a)</samp>](vitest-dev/vitest@4325ac67)
-   **browser**:
    -   Remove [@&#8203;testing-library/dom](https://github.com/testing-library/dom) from dependencies  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7555 [<samp>(5387a)</samp>](vitest-dev/vitest@5387a5b3)
    -   Improve source map handling for bundled files  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7534 [<samp>(e2c57)</samp>](vitest-dev/vitest@e2c570b6)
    -   Print related test file and potential test in unhandled errors  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7564 [<samp>(fee90)</samp>](vitest-dev/vitest@fee90d85)
-   **runner**:
    -   Fix `beforeEach/All` cleanup callback timeout  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7500 [<samp>(0c292)</samp>](vitest-dev/vitest@0c2924b7)
    -   Fix and simplify `Task.suite` initialization  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7414 [<samp>(ca9ff)</samp>](vitest-dev/vitest@ca9ffac5)
-   **snapshot**:
    -   Allow inline snapshot calls on same location with same snapshot  -  by [@&#8203;jycouet](https://github.com/jycouet) and [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7464 [<samp>(d5cb8)</samp>](vitest-dev/vitest@d5cb8212)
-   **vite-node**:
    -   Fix `buildStart` on Vite 6  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7480 [<samp>(c0f47)</samp>](vitest-dev/vitest@c0f47e03)

#####     [View changes on GitHub](vitest-dev/vitest@v3.0.7...v3.0.8)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xODguNCIsInVwZGF0ZWRJblZlciI6IjM5LjE4OC40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://gitea.justinelmore.dev/jelmore1674/build-changelog/pulls/95
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cleanup functions from beforeEach/All hooks doesn't timeout

2 participants