feat: add color differentiation for actual/expected values in test failures#38
Draft
feat: add color differentiation for actual/expected values in test failures#38
Conversation
…ilures - Parse @hapi/lab failure output to extract actual and expected values - Set TestMessage actualOutput and expectedOutput properties to enable VS Code's diff view - Add comprehensive tests for parseErrorMessage function - Export parseErrorMessage for testing purposes Co-authored-by: mtharrison <916064+mtharrison@users.noreply.github.com>
- Update cleanValue function to only remove quotes when they appear at both start and end - Prevents incorrect quote removal from mismatched or single-sided quotes - Addresses code review feedback Co-authored-by: mtharrison <916064+mtharrison@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add colour differentiation for actual and expected values in test output
feat: add color differentiation for actual/expected values in test failures
Jan 21, 2026
Owner
@copilot I would like to see colour coded comparison between expected and actual assertion in the tooltip next to the test name
|
- Update regex to match "to include" and "to contain" patterns in addition to "to equal" - Add tests for include and contain assertion failures - Fixes color differentiation for @hapi/code assertions like "expect(x).to.include(y)" Co-authored-by: mtharrison <916064+mtharrison@users.noreply.github.com>
Contributor
Author
Updated the regex pattern in commit 81c4dc6 to support "to include" and "to contain" assertions in addition to "to equal". The extension now extracts actual and expected values from assertions like:
When both |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Test failure output shows actual and expected values in the same color, making mismatches hard to spot:
Changes
Expected <actual> to equal specified value: <expected>Expected <actual> to include <expected>Expected <actual> to contain <expected>(displays as "include")actualOutputandexpectedOutputto trigger VS Code's native diff view with red/green highlightingImplementation
Added
FailureInfointerface and enhancedparseErrorMessage():Applies to inline editor decorations, Test Explorer tooltips, and the Test Results panel.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.