Skip to content

test: Vitest v4#2158

Draft
colinaaa wants to merge 23 commits intolynx-family:mainfrom
colinaaa:colin/0130/vitest-v4
Draft

test: Vitest v4#2158
colinaaa wants to merge 23 commits intolynx-family:mainfrom
colinaaa:colin/0130/vitest-v4

Conversation

@colinaaa
Copy link
Collaborator

See: https://vitest.dev/guide/migration

@coderabbitai summary

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: ff6b5dc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lynx-js/testing-environment Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@relativeci
Copy link

relativeci bot commented Jan 30, 2026

Web Explorer

#7557 Bundle Size — 383.72KiB (0%).

ff6b5dc(current) vs bf1a177 main#7552(baseline)

Bundle metrics  Change 1 change
                 Current
#7557
     Baseline
#7552
No change  Initial JS 154.88KiB 154.88KiB
No change  Initial CSS 35.05KiB 35.05KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 237(-0.42%) 238
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.99% 2.99%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7557
     Baseline
#7552
No change  JS 252.83KiB 252.83KiB
No change  Other 95.85KiB 95.85KiB
No change  CSS 35.05KiB 35.05KiB

Bundle analysis reportBranch colinaaa:colin/0130/vitest-v4Project dashboard


Generated by RelativeCIDocumentationReport issue

```
× TS2468: Cannot find global value 'Promise'.

File: ./src/__tests__/index.test.tsx:10:13
```
```
TypeCheckError: No overload matches this call.
  The last overload gave the following error.
    Type 'Plugin<any>' is not assignable to type 'PluginOption'.
      Type 'import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/rollup@4.57.0/node_modules/rollup/dist/rollup").Plugin<any>' is not assignable to type 'import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/vite@7.3.1_@types+node@24.6.1_jiti@2.6.1_sass-embedded@1.90.0_sass@1.90.0_terser@5.31.6_yaml@2.8.1/node_modules/vite/dist/node/index", { with { "resolution-mode" "import" } }).Plugin<any>' with 'exactOptionalPropertyTypes true'. Consider adding 'undefined' to the types of the target's properties.
        Types of property 'resolveId' are incompatible.
          Type 'ObjectHook<(this PluginContext, source string, importer string | undefined, options { attributes Record<string, string>; custom? CustomPluginOptions; importerAttributes? Record<string, string> | undefined; isEntry boolean; }) => ResolveIdResult | Promise<...>, { ...; }>' is not assignable to type 'ObjectHook<(this PluginContext, source string, importer string | undefined, options { attributes Record<string, string>; custom? CustomPluginOptions; ssr? boolean | undefined; isEntry boolean; }) => ResolveIdResult | Promise<...>, { ...; }>'.
            Type '{ handler (this PluginContext, source string, importer string | undefined, options { attributes Record<string, string>; custom? CustomPluginOptions; importerAttributes? Record<...> | undefined; isEntry boolean; }) => ResolveIdResult | Promise<...>; order? "pre" | ... 1 more ... | null; } & { ...; }' is not assignable to type 'ObjectHook<(this PluginContext, source string, importer string | undefined, options { attributes Record<string, string>; custom? CustomPluginOptions; ssr? boolean | undefined; isEntry boolean; }) => ResolveIdResult | Promise<...>, { ...; }>'.
              Type '{ handler (this PluginContext, source string, importer string | undefined, options { attributes Record<string, string>; custom? CustomPluginOptions; importerAttributes? Record<...> | undefined; isEntry boolean; }) => ResolveIdResult | Promise<...>; order? "pre" | ... 1 more ... | null; } & { ...; }' is not assignable to type '{ handler (this PluginContext, source string, importer string | undefined, options { attributes Record<string, string>; custom? CustomPluginOptions; ssr? boolean | undefined; isEntry boolean; }) => ResolveIdResult | Promise<...>; order? "pre" | ... 1 more ... | null; } & { ...; }' with 'exactOptionalPropertyTypes true'. Consider adding 'undefined' to the types of the target's properties.
                Type '{ handler (this PluginContext, source string, importer string | undefined, options { attributes Record<string, string>; custom? CustomPluginOptions; importerAttributes? Record<...> | undefined; isEntry boolean; }) => ResolveIdResult | Promise<...>; order? "pre" | ... 1 more ... | null; } & { ...; }' is not assignable to type '{ filter? { id? StringFilter<RegExp>; }; }' with 'exactOptionalPropertyTypes true'. Consider adding 'undefined' to the types of the target's properties.
                  The types of 'filter.id' are incompatible between these types.
                    Type 'StringFilter<RegExp> | undefined' is not assignable to type 'StringFilter<RegExp>'.
                      Type 'undefined' is not assignable to type 'StringFilter<RegExp>'.
 ❯ packages/rspeedy/plugin-config/vitest.config.ts:18:5
 ```
const runnerMode = getCodspeedRunnerMode();
const config = {
test: {
+ execArgv: getV8Flags(), // For Vitest v4
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 30, 2026

CodSpeed Performance Report

Merging this PR will degrade performance by 10.08%

Comparing colinaaa:colin/0130/vitest-v4 (ff6b5dc) with main (bf1a177)

Summary

❌ 2 regressed benchmarks
✅ 61 untouched benchmarks
⏩ 3 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
basic-performance-nest-level-100 6.9 ms 7.5 ms -6.99%
transform 1000 view elements 42.3 ms 47 ms -10.08%

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@colinaaa
Copy link
Collaborator Author

It looks like all the CI pipelines are passing except 100% coverage for react/*.

I'll adopt the experimentalAstAwareRemapping flag first in Vitest v3 before merging this PR to avoid making to much changes.

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.

1 participant