Skip to content

Add unit tests for OutputVerifier - #3047

Open
ConnorQi01 wants to merge 1 commit into
masterfrom
dev/v-peq/issue-2950-outputVerifier_tests
Open

ConnorQi01 wants to merge 1 commit into
masterfrom
dev/v-peq/issue-2950-outputVerifier_tests

Conversation

@ConnorQi01

Copy link
Copy Markdown
Collaborator

Summary

Add unit tests for src/common/outputVerifier.ts. This class verifies spawn process output against success/failure patterns and was previously untested.

Proposed Changes

Add test/extension/outputVerifier.test.ts with 8 test cases covering:

  • Resolves when all success patterns are found on stdout
  • Rejects when not all success patterns are found
  • Rejects when a string failure pattern matches stderr
  • Rejects when a RegExp failure pattern matches, verifying error code is included
  • Rejects with process error when outcome rejects and no failure pattern matches
  • Augments processError.message with failure pattern info when both occur simultaneously
  • Matches success patterns case-insensitively
  • Checks failure patterns against combined stderr and stdout

Test Plan

  • npm test — all 8 new tests pass, 537 total passing

Closes #2950

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@ConnorQi01

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

This branch has not been deployed

No deployments
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.

[Feature] Add unit tests for OutputVerifier

2 participants