Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

The commit renames all instances of rsbuildConfig to config in test files to make them shorter.

Related Links

#6245

Checklist

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

Copilot AI review requested due to automatic review settings September 24, 2025 14:09
@netlify
Copy link

netlify bot commented Sep 24, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 34e1361
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68d3fba0ebdaf400082c9a33
😎 Deploy Preview https://deploy-preview-6246--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 68 (🟢 up 19 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR renames the rsbuildConfig parameter to config in test files throughout the Rsbuild codebase to make the test code more concise and consistent. The change also adds backward compatibility by keeping rsbuildConfig as a deprecated alias.

  • Updates all test files to use config instead of rsbuildConfig when calling test utilities
  • Adds backward compatibility support for the deprecated rsbuildConfig parameter
  • Updates type definitions to reflect the new parameter name with deprecation notices

Reviewed Changes

Copilot reviewed 173 out of 173 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/types/rsbuild.ts Adds config parameter and marks rsbuildConfig as deprecated
packages/core/src/createRsbuild.ts Updates parameter handling to support both config and rsbuildConfig
packages/core/src/cli/init.ts Updates CLI initialization to use config parameter
e2e/helper/jsApi.ts Updates test helper to use config parameter
packages/compat/webpack/tests/helper.ts Updates webpack compatibility test helper
Multiple test files Renames rsbuildConfig to config in test configurations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

@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 suggestions.

const rsbuildConfig =
typeof options.rsbuildConfig === 'function'
? await options.rsbuildConfig()
: options.rsbuildConfig || {};
const rsbuildOptions = {
cwd: process.env.REBUILD_TEST_SUITE_CWD || process.cwd(),
...options,
rsbuildConfig,

[P1] Stub helper ignores new config option

The tests were rewritten to pass their configuration through a config property, but createStubRsbuild still reads only options.rsbuildConfig when constructing the stub instance. Any options passed via config are now silently discarded and the tests run against an empty configuration. This breaks many unit tests that rely on custom settings (e.g. source entries, output tweaks) and makes the commit’s test suite fail or produce invalid assertions.


// Rstest Snapshot v1
exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = `
{
"context": "<ROOT>/packages/core/tests",
"devtool": "cheap-module-source-map",
"entry": {
"index": [
"./src/index.js",
],
},
"experiments": {
"asyncWebAssembly": true,
"inlineConst": false,
"inlineEnum": false,
"lazyBarrel": true,
"rspackFuture": {
"bundlerInfo": {
"force": false,
},
},
"typeReexportsPresence": true,
},
"infrastructureLogging": {
"level": "error",
},
"lazyCompilation": {
"entries": false,
"imports": true,
},
"mode": "development",
"module": {
"parser": {
"javascript": {
"exportsPresence": "error",
"inlineConst": false,
"typeReexportsPresence": "tolerant",
},
},
"rules": [
{
"resolve": {
"fullySpecified": false,
},
"test": /\\\\\\.m\\?js/,
},
{

[P1] Snapshot files deleted while tests still call toMatchSnapshot

All Jest snapshots for the core package were removed (for example __snapshots__/default.test.ts.snap), yet the corresponding tests continue to use expect(...).toMatchSnapshot(). Without the snapshot files, pnpm test will immediately fail because Jest cannot find the stored expectations. Unless the tests are converted to inline snapshots or updated to assert differently, these snapshot files should not be deleted.


Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

@chenjiahan chenjiahan merged commit 053405a into main Sep 25, 2025
11 checks passed
@chenjiahan chenjiahan deleted the test_shorten_config_0924 branch September 25, 2025 02:24
@chenjiahan chenjiahan mentioned this pull request Sep 29, 2025
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.

2 participants