Skip to content

feat: support show assertion calls when test timeout#753

Merged
9aoy merged 5 commits intomainfrom
timeout-tips
Dec 11, 2025
Merged

feat: support show assertion calls when test timeout#753
9aoy merged 5 commits intomainfrom
timeout-tips

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Dec 10, 2025

Summary

support show assertion calls when test timeout.

before:
img_v3_02sr_3456c66a-0e43-415f-b597-954853d837cg

after:
img_v3_02sr_bbaf99a3-64a5-4faa-b9cd-84015602463g

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings December 10, 2025 11:15
@netlify
Copy link
Copy Markdown

netlify bot commented Dec 10, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit e88e7aa
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/69395a916e23f0000856e41f
😎 Deploy Preview https://deploy-preview-753--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
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 enhances timeout error messages to display the number of completed expect assertions when a test times out, providing better debugging information to developers.

Key Changes

  • Modified the timeout error message to include assertion count information: "(completed N expect assertions)" or "(no expect assertions completed)"
  • Moved timeout wrapping from test registration time to execution time to access runtime assertion counts
  • Added stackTraceError as a required field on TestCase type to preserve correct stack traces pointing to test definitions

Reviewed changes

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

Show a summary per file
File Description
packages/core/src/types/testSuite.ts Added required stackTraceError field to TestCase type to store stack trace at test registration
packages/core/src/runtime/runner/task.ts Enhanced wrapTimeout to accept getAssertionCalls callback and include assertion count in timeout messages
packages/core/src/runtime/runner/runtime.ts Removed early timeout wrapping and instead stores stackTraceError at test registration
packages/core/src/runtime/runner/runner.ts Moved timeout wrapping to test execution time with assertion count tracking
e2e/test-api/timeout.test.ts Updated test expectations to verify new timeout message format with assertion information
e2e/test-api/fixtures/timeout.test.ts Changed to use local expect from context instead of global import

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

9aoy and others added 4 commits December 10, 2025 19:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@9aoy 9aoy merged commit 04f3c08 into main Dec 11, 2025
16 checks passed
@9aoy 9aoy deleted the timeout-tips branch December 11, 2025 02:52
@9aoy 9aoy mentioned this pull request Dec 15, 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