Skip to content

docs: add global API types tip when migrating from jest#1020

Merged
9aoy merged 1 commit intomainfrom
docs/jest-global-type
Mar 6, 2026
Merged

docs: add global API types tip when migrating from jest#1020
9aoy merged 1 commit intomainfrom
docs/jest-global-type

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Mar 6, 2026

Summary

add global API types tip when migrating from jest.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying rstest with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4c7e466
Status: ✅  Deploy successful!
Preview URL: https://f2528b83.rstest.pages.dev
Branch Preview URL: https://docs-jest-global-type.rstest.pages.dev

View logs

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c7e4661ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

```ts title='tsconfig.json'
{
"compilerOptions": {
"types": ["@rstest/core/globals"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve existing tsconfig types when adding globals

This example replaces compilerOptions.types with only @rstest/core/globals, which causes TypeScript to include just that ambient package list; users who copy it during migration can inadvertently drop existing entries (for example Node or framework-specific globals) and then hit missing-type errors in their tests and config files. Please document this as appending to an existing types array (or explicitly preserving current entries) rather than overwriting it.

Useful? React with 👍 / 👎.

@9aoy 9aoy merged commit bd6ec61 into main Mar 6, 2026
7 checks passed
@9aoy 9aoy deleted the docs/jest-global-type branch March 6, 2026 08:32
@9aoy 9aoy mentioned this pull request Mar 9, 2026
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.

1 participant