Skip to content

test: fix flaky watch files case#5860

Merged
chenjiahan merged 3 commits intomainfrom
watch_files_0817
Aug 17, 2025
Merged

test: fix flaky watch files case#5860
chenjiahan merged 3 commits intomainfrom
watch_files_0817

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

  • Fix flaky watch files case
  • Replacing manual child process termination with a new close() helper
  • Enhancing the runCli utility to support log assertions
Screenshot 2025-08-16 at 16 29 42

Checklist

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

Copilot AI review requested due to automatic review settings August 17, 2025 00:59
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 17, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 87fde1b
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68a12ac61d19bc0008069fb2
😎 Deploy Preview https://deploy-preview-5860--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: 72 (🔴 down 4 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
Copy Markdown
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 fixes flaky watch files test cases by improving the test infrastructure and simplifying the test approach. The changes replace manual child process termination with a new close() helper function and enhance the runCli utility to support log assertions for more reliable testing.

Key changes:

  • Enhanced runCli utility with log capture and assertion capabilities
  • Simplified watch files test to use DOM assertions instead of file system checks
  • Replaced manual childProcess.kill() calls with a standardized close() method across all CLI tests

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
e2e/scripts/shared.ts Enhanced runCli function with log capture, assertion methods, and standardized close functionality
e2e/cases/cli/watch-files/src/index.js Changed from console logging to DOM manipulation for testable output
e2e/cases/cli/watch-files/rsbuild.config.ts Simplified configuration by removing test plugin and using source.define for content injection
e2e/cases/cli/watch-files/index.test.ts Rewrote test to use DOM assertions and new runCli utilities instead of file system checks
Multiple test files Updated to use new close() method from enhanced runCli return value

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

@chenjiahan chenjiahan merged commit ad77161 into main Aug 17, 2025
11 checks passed
@chenjiahan chenjiahan deleted the watch_files_0817 branch August 17, 2025 01:15
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