Skip to content

test(e2e): add tests to verify env mode command handling#6477

Merged
chenjiahan merged 2 commits intomainfrom
e2e_mode_1031
Oct 31, 2025
Merged

test(e2e): add tests to verify env mode command handling#6477
chenjiahan merged 2 commits intomainfrom
e2e_mode_1031

Conversation

@chenjiahan
Copy link
Member

Summary

Added new e2e tests to verify that builds correctly reflect different environment variables (NODE_ENV) and environment modes (env-mode) in the configuration function.

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings October 31, 2025 13:50
@netlify
Copy link

netlify bot commented Oct 31, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit a60e542
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/6904c0c54c6aac00097279a1
😎 Deploy Preview https://deploy-preview-6477--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: 71 (🟢 up 3 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 modifies the function-based config feature to test the envMode parameter and updates the vanilla example to demonstrate config function usage. The changes add support for testing the envMode parameter alongside env and command in the defineConfig callback.

Key Changes

  • Added envMode parameter support to the function config test case
  • Updated tests to verify proper values for env, envMode, and command parameters
  • Updated vanilla example to demonstrate function-based config with environment checks

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
examples/vanilla/rsbuild.config.ts Changed from empty config to function-based config with environment logging
e2e/cases/cli/function-config/src/index.js Changed console output from static string to DEFINED_VALUE placeholder
e2e/cases/cli/function-config/rsbuild.config.ts Added envMode parameter and replaced output config with source.define config
e2e/cases/cli/function-config/index.test.ts Restructured tests to use single distDir, added envMode test cases, and updated assertions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit 2847816 into main Oct 31, 2025
11 checks passed
@chenjiahan chenjiahan deleted the e2e_mode_1031 branch October 31, 2025 23:35
@chenjiahan chenjiahan mentioned this pull request Nov 3, 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.

1 participant