Skip to content

chore: decouple expect matchers from parent src/ imports#40131

Merged
dgozman merged 1 commit intomicrosoft:mainfrom
dgozman:chore-expect-matchers-decouple
Apr 9, 2026
Merged

chore: decouple expect matchers from parent src/ imports#40131
dgozman merged 1 commit intomicrosoft:mainfrom
dgozman:chore-expect-matchers-decouple

Conversation

@dgozman
Copy link
Copy Markdown
Collaborator

@dgozman dgozman commented Apr 9, 2026

Summary

  • Matchers no longer import from ../globals, ../util, or ../common — reversed dependency via setExpectConfig() injection from workerMain.ts
  • Added ExpectTestInfo/ExpectStepInfo/ExpectStep interfaces so matchers don't depend on TestInfoImpl
  • Moved expectUtils.ts from @utils to @isomorphic, keeping only serializeExpectedTextValues
  • Moved formatting helpers into matcherHint.ts
  • Moved _deadlineForMatcher logic into matchers, exposing _deadline() on TestInfo
  • Combined _hasNonRetriableError into _failWithError(error, 'shouldNotRetry')

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@dgozman dgozman force-pushed the chore-expect-matchers-decouple branch from 591a051 to 67db9fe Compare April 9, 2026 18:53
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Reverse the dependency so matchers are self-contained:
- Add ExpectTestInfo/ExpectStepInfo/ExpectStep interfaces in matchers/expect.ts
- Inject config via setExpectConfig() from workerMain.ts
- Move expectUtils.ts from @utils to @isomorphic
- Move formatting helpers from expectUtils to matcherHint.ts
- Inline addSuffixToFilePath and fileExistsAsync into matchers
- Remove ../globals.ts and ../util.ts from matchers/DEPS.list
- Move _deadlineForMatcher logic into matchers, expose _deadline() on TestInfo
- Combine _hasNonRetriableError into _failWithError(error, 'shouldNotRetry')
@dgozman dgozman force-pushed the chore-expect-matchers-decouple branch from 67db9fe to ce009c7 Compare April 9, 2026 20:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Test results for "MCP"

1 failed
❌ [firefox] › mcp/cli-test.spec.ts:23 › debug test and snapshot @mcp-windows-latest

6467 passed, 383 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Test results for "tests 1"

5 flaky ⚠️ [chromium-library] › library/screencast.spec.ts:28 › screencast.start delivers frames via onFrame callback `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:652 › screencast › should capture full viewport `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:724 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node24`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1080 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-ubuntu-22.04-node20`

39160 passed, 846 skipped


Merge workflow run.

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