-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(vitest): logs in beforeAll
and afterAll
#5288
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for fastidious-cascaron-4ded94 canceled.
|
sheremet-va
reviewed
Feb 26, 2024
sheremet-va
previously approved these changes
Mar 14, 2024
@fenghan34 hey! can you fix merge conflicts when you have time, please? 🙏🏻 |
Sure I will do it soon |
renovate bot
referenced
this pull request
in Johannes-Andersen/Johannes
Mar 15, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@vitest/coverage-v8](https://togithub.com/vitest-dev/vitest/tree/main/packages/coverage-v8#readme) ([source](https://togithub.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8)) | [`1.3.1` -> `1.4.0`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-v8/1.3.1/1.4.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@vitest%2fcoverage-v8/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vitest%2fcoverage-v8/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vitest%2fcoverage-v8/1.3.1/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vitest%2fcoverage-v8/1.3.1/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [vitest](https://togithub.com/vitest-dev/vitest) ([source](https://togithub.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | [`1.3.1` -> `1.4.0`](https://renovatebot.com/diffs/npm/vitest/1.3.1/1.4.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/vitest/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/vitest/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/vitest/1.3.1/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vitest/1.3.1/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vitest-dev/vitest (@​vitest/coverage-v8)</summary> ### [`v1.4.0`](https://togithub.com/vitest-dev/vitest/releases/tag/v1.4.0) ##### 🚀 Features - Throw error when using snapshot assertion with `not` - by [@​fenghan34](https://togithub.com/fenghan34) in [https://github.com/vitest-dev/vitest/issues/5294](https://togithub.com/vitest-dev/vitest/issues/5294) [<samp>(b9d37)</samp>](https://togithub.com/vitest-dev/vitest/commit/b9d378f5) - Add a flag to include test location in tasks - by [@​sheremet-va](https://togithub.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/5342](https://togithub.com/vitest-dev/vitest/issues/5342) [<samp>(d627e)</samp>](https://togithub.com/vitest-dev/vitest/commit/d627e209) - **cli**: - Support wildcards in `--project` option - by [@​fenghan34](https://togithub.com/fenghan34) in [https://github.com/vitest-dev/vitest/issues/5295](https://togithub.com/vitest-dev/vitest/issues/5295) [<samp>(201bd)</samp>](https://togithub.com/vitest-dev/vitest/commit/201bd067) - **config**: - Add `shuffle.files` and `shuffle.tests` options - by [@​fenghan34](https://togithub.com/fenghan34) in [https://github.com/vitest-dev/vitest/issues/5281](https://togithub.com/vitest-dev/vitest/issues/5281) [<samp>(356db)</samp>](https://togithub.com/vitest-dev/vitest/commit/356db87b) - Deprecate `cache.dir` option - by [@​fenghan34](https://togithub.com/fenghan34) in [https://github.com/vitest-dev/vitest/issues/5229](https://togithub.com/vitest-dev/vitest/issues/5229) [<samp>(d7e8b)</samp>](https://togithub.com/vitest-dev/vitest/commit/d7e8b53e) - **coverage**: - Support `--changed` option - by [@​AriPerkkio](https://togithub.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/5314](https://togithub.com/vitest-dev/vitest/issues/5314) [<samp>(600b4)</samp>](https://togithub.com/vitest-dev/vitest/commit/600b44d6) - **vitest**: - Support `clearScreen` cli flag - by [@​hi-ogawa](https://togithub.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/5241](https://togithub.com/vitest-dev/vitest/issues/5241) [<samp>(e1735)</samp>](https://togithub.com/vitest-dev/vitest/commit/e1735fb6) ##### 🐞 Bug Fixes - Repeatable `--project` option - by [@​fenghan34](https://togithub.com/fenghan34) in [https://github.com/vitest-dev/vitest/issues/5265](https://togithub.com/vitest-dev/vitest/issues/5265) [<samp>(d1a06)</samp>](https://togithub.com/vitest-dev/vitest/commit/d1a06730) - `--inspect-brk` to pause before execution - by [@​AriPerkkio](https://togithub.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/5355](https://togithub.com/vitest-dev/vitest/issues/5355) [<samp>(e77c5)</samp>](https://togithub.com/vitest-dev/vitest/commit/e77c553f) - Correct locations in test.each tasks - by [@​sheremet-va](https://togithub.com/sheremet-va) [<samp>(4f6e3)</samp>](https://togithub.com/vitest-dev/vitest/commit/4f6e39c1) - **api**: - Use resolvedUrls from devserver - by [@​saitonakamura](https://togithub.com/saitonakamura) and [@​hi-ogawa](https://togithub.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/5289](https://togithub.com/vitest-dev/vitest/issues/5289) [<samp>(2fef5)</samp>](https://togithub.com/vitest-dev/vitest/commit/2fef5a7e) - **browser**: - Add `magic-string` to `optimizeDeps.include` - by [@​hi-ogawa](https://togithub.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/5278](https://togithub.com/vitest-dev/vitest/issues/5278) [<samp>(8f04e)</samp>](https://togithub.com/vitest-dev/vitest/commit/8f04e798) - **coverage**: - Expensive regexp hangs v8 report generation - by [@​AriPerkkio](https://togithub.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/5259](https://togithub.com/vitest-dev/vitest/issues/5259) [<samp>(d68a7)</samp>](https://togithub.com/vitest-dev/vitest/commit/d68a7390) - V8 to ignore type-only files - by [@​AriPerkkio](https://togithub.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/5328](https://togithub.com/vitest-dev/vitest/issues/5328) [<samp>(c3eb8)</samp>](https://togithub.com/vitest-dev/vitest/commit/c3eb8deb) - Respect source maps of pre-transpiled sources - by [@​AriPerkkio](https://togithub.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/5367](https://togithub.com/vitest-dev/vitest/issues/5367) [<samp>(6eda4)</samp>](https://togithub.com/vitest-dev/vitest/commit/6eda473f) - Prevent `reportsDirectory` from removing user's project - by [@​AriPerkkio](https://togithub.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/5376](https://togithub.com/vitest-dev/vitest/issues/5376) [<samp>(07ec3)</samp>](https://togithub.com/vitest-dev/vitest/commit/07ec3779) - **expect**: - Show diff on `toContain/toMatch` assertion error - by [@​hi-ogawa](https://togithub.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/5267](https://togithub.com/vitest-dev/vitest/issues/5267) [<samp>(8ee59)</samp>](https://togithub.com/vitest-dev/vitest/commit/8ee59f0d) - **forks**: - Wrap `defines` to support `undefined` values - by [@​AriPerkkio](https://togithub.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/5284](https://togithub.com/vitest-dev/vitest/issues/5284) [<samp>(5b58b)</samp>](https://togithub.com/vitest-dev/vitest/commit/5b58b399) - **typecheck**: - Update get-tsconfig 4.7.3 to fix false circularity error - by [@​hi-ogawa](https://togithub.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/5384](https://togithub.com/vitest-dev/vitest/issues/5384) [<samp>(bdc37)</samp>](https://togithub.com/vitest-dev/vitest/commit/bdc371ee) - **ui**: - Escape html in error diff - by [@​hi-ogawa](https://togithub.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/5325](https://togithub.com/vitest-dev/vitest/issues/5325) [<samp>(ab60b)</samp>](https://togithub.com/vitest-dev/vitest/commit/ab60bf8d) - **vitest**: - Loosen `onConsoleLog` return type - by [@​hi-ogawa](https://togithub.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/5337](https://togithub.com/vitest-dev/vitest/issues/5337) [<samp>(6d1b1)</samp>](https://togithub.com/vitest-dev/vitest/commit/6d1b1451) - Ensure restoring terminal cursor on close - by [@​hi-ogawa](https://togithub.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/5292](https://togithub.com/vitest-dev/vitest/issues/5292) [<samp>(0bea2)</samp>](https://togithub.com/vitest-dev/vitest/commit/0bea2247) - Ignore timeout on websocket reporter rpc - by [@​sheremet-va](https://togithub.com/sheremet-va) [<samp>(38119)</samp>](https://togithub.com/vitest-dev/vitest/commit/38119b75) - Correctly override api with --no-api flag - by [@​sheremet-va](https://togithub.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/5386](https://togithub.com/vitest-dev/vitest/issues/5386) [<samp>(51d1d)</samp>](https://togithub.com/vitest-dev/vitest/commit/51d1d472) - Logs in `beforeAll` and `afterAll` - by [@​fenghan34](https://togithub.com/fenghan34) in [https://github.com/vitest-dev/vitest/issues/5288](https://togithub.com/vitest-dev/vitest/issues/5288) [<samp>(ce5ca)</samp>](https://togithub.com/vitest-dev/vitest/commit/ce5ca6bf) - **workspace**: - Throw error when browser mode and `@vitest/coverage-v8` are used - by [@​AriPerkkio](https://togithub.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/5250](https://togithub.com/vitest-dev/vitest/issues/5250) [<samp>(29f98)</samp>](https://togithub.com/vitest-dev/vitest/commit/29f98cd3) ##### [View changes on GitHub](https://togithub.com/vitest-dev/vitest/compare/v1.3.1...v1.4.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **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 [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Johannes-Andersen/Johannes). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNDUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI0NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This was referenced May 21, 2024
This was referenced May 26, 2024
This was referenced Jun 7, 2024
This was referenced Jul 8, 2024
Open
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Closes Logs in beforeAll missing from HTML report #3366
I think the reason why logs in hooks
beforeAll
andafterAll
are missing from the HTML report is because these logs are not attached to the related tasks they were contained in.vitest/packages/vitest/src/runtime/console.ts
Line 88 in 5bb8b38
Here's the comparison between without and with this PR:
Before
After
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.