FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: deprecate old context augmentation and recommend test.extend by sheremet-va · Pull Request #7703 · vitest-dev/vitest · GitHub

docs: deprecate old context augmentation and recommend test.extend - #7703

Merged
sheremet-va merged 6 commits into
vitest-dev:mainfrom
sheremet-va:feat/deprecate-old-context
May 2, 2025
Merged

sheremet-va merged 6 commits into
vitest-dev:mainfrom
sheremet-va:feat/deprecate-old-context

Conversation

Copy link
Copy Markdown
Member

Description

Related: #7701

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 Bot commented Mar 19, 2025

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit c22ea36
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/67dadd2499d21500085986a7
😎 Deploy Preview https://deploy-preview-7703--vitest-dev.netlify.app
📱 Preview on mobile Toggle QR Code...



Use your smartphone camera to open QR code link.

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

netlify Bot commented Mar 19, 2025
edited
Loading

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 38a8407
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/6814b1dbab9f870008f9fac8
😎 Deploy Preview https://deploy-preview-7703--vitest-dev.netlify.app
📱 Preview on mobile Toggle 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 left a comment
edited
Loading

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Sounds good to me, but is it possible for us to ban mutating to do anything ctx.foo = "bar"? 🤔 I feel like this is something automatically working and would we need an extra code to forcefully not allow this kind of mutation?
(Maybe banning runtime is not necessary as long as we can hide such API from typing?)

Copy link
Copy Markdown
Member Author

Sounds good to me, but is it possible for us to ban mutating to do anything ctx.foo = "bar"? 🤔 I feel like this is something automatically working and would we need an extra code to forcefully not allow this kind of mutation?

(Maybe banning runtime is not necessary as long as we can hide such API from typing?)

What is the benefit of banning this? If you don't use test.extend, there is no other way to extend the context. If you are using it, it will already throw an error.

Copy link
Copy Markdown
Collaborator

I'm not necessary suggesting to ban, but then what does deprecating mean in this PR? Isn't it only clarifying beforeEach(ctx) { ctx.foo } and test.extend don't work together?

sheremet-va commented Mar 20, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

I'm not necessary suggesting to ban, but then what does deprecating mean in this PR? Isn't it only clarifying beforeEach(ctx) { ctx.foo } and test.extend don't work together?

Yes, it just clarifies that we don't recommend it and these examples will be removed in the next major.

I want us to have a single way of working with context, just like we decided to promote the inline workspace.

sheremet-va moved this to P2 - 5 in Team Board Mar 25, 2025
sheremet-va added the p2-to-be-discussed Enhancement under consideration (priority) label Mar 31, 2025
sheremet-va changed the title feat: deprecate old context augmentation and recommend test.extend docs: deprecate old context augmentation and recommend test.extend Apr 16, 2025
sheremet-va moved this from P2 - 5 to Approved in Team Board May 1, 2025

Copy link
Copy Markdown
Member

Sounds good 👍

sheremet-va merged commit ca743ed into vitest-dev:main May 2, 2025
sheremet-va deleted the feat/deprecate-old-context branch May 2, 2025 12:05
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-to-be-discussed Enhancement under consideration (priority)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL