Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Nov 3, 2025

Summary

Support log heap usage for each test via logHeapUsage configuration, it can help to find memory leaks in tests.

image

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings November 3, 2025 05:33
@netlify
Copy link

netlify bot commented Nov 3, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit e16a43e
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/690844b87f6ba00008fddf20
😎 Deploy Preview https://deploy-preview-666--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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 adds a new logHeapUsage configuration option to enable logging heap memory usage after each test, which helps developers identify memory leaks in their test suites.

Key changes:

  • Adds logHeapUsage boolean configuration option with default value false
  • Captures heap usage using process.memoryUsage().heapUsed and displays it in test output
  • Adds documentation in both English and Chinese for the new feature

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/core/src/types/config.ts Adds logHeapUsage boolean config option with JSDoc
packages/core/src/config.ts Sets default value to false in default config
packages/core/src/cli/commands.ts Adds CLI flag --logHeapUsage
packages/core/src/cli/init.ts Includes logHeapUsage in CommonOptions and config resolution
packages/core/src/types/worker.ts Adds logHeapUsage to RuntimeConfig type
packages/core/src/pool/index.ts Propagates logHeapUsage to runtime config
packages/core/src/types/testSuite.ts Adds optional heap property to TestResult
packages/core/src/runtime/runner/runner.ts Captures heap usage when enabled at three points in test execution
packages/core/src/reporter/utils.ts Formats and displays heap usage in test output
website/theme/components/ConfigOverview.tsx Reorders config groups and adds logHeapUsage to output section
website/docs/en/config/test/logHeapUsage.mdx Adds English documentation
website/docs/zh/config/test/logHeapUsage.mdx Adds Chinese documentation
website/docs/en/config/test/_meta.json Registers new config page in navigation
website/docs/zh/config/test/_meta.json Registers new config page in navigation
e2e/reporter/index.test.ts Adds e2e test for logHeapUsage feature
packages/core/rslib.config.ts Refactors version import to use ES module syntax
Test snapshots Updates snapshots to include new logHeapUsage: false field

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

@9aoy 9aoy merged commit 44daf8d into main Nov 3, 2025
25 of 26 checks passed
@9aoy 9aoy deleted the logHeapUsage branch November 3, 2025 07:16
@9aoy 9aoy mentioned this pull request Nov 5, 2025
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.

2 participants