From fe12208e3076b2f8d503a94baab71b3aa7183653 Mon Sep 17 00:00:00 2001 From: Nguyen Thanh Dat Date: Wed, 26 Aug 2026 18:10:12 +0700 Subject: [PATCH] test(claude-web): anchor on the alias wiring, not on how the map builds it (#11585) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merged via /merge-batch (lote 2026-08-26, v3.8.51). Boarded no worktree combinado junto com outras ~30 PRs; validação única: typecheck/complexity/cognitive-complexity/changelog-integrity verdes, file-size rebaseado onde necessário (crescimento legítimo), lint com os mesmos 228 achados pré-existentes confirmados via sonda contra o tip puro (não introduzidos por este lote), e ~370 testes focados (unit + vitest) passando. Obrigado pela contribuição. --- .../maintenance/11585-claude-web-anchor-lazy-map.md | 1 + tests/unit/claude-web-transport.test.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changelog.d/maintenance/11585-claude-web-anchor-lazy-map.md diff --git a/changelog.d/maintenance/11585-claude-web-anchor-lazy-map.md b/changelog.d/maintenance/11585-claude-web-anchor-lazy-map.md new file mode 100644 index 0000000000..9c35764812 --- /dev/null +++ b/changelog.d/maintenance/11585-claude-web-anchor-lazy-map.md @@ -0,0 +1 @@ +- **test(claude-web):** the Claude Web transport test's barrel anchors no longer pin the exact construction spelling. #11421 made the executor map lazy, so `/"claude-web": new ClaudeWebExecutor\(\)/` stopped matching and the test went red on `release/v3.8.51` itself — a base-red gate every open PR inherited. The anchors now match the alias key and the class name and tolerate either spelling in between, and were checked to still fail when an alias is genuinely repointed at another executor ([#11585](https://github.com/diegosouzapw/OmniRoute/pull/11585)) diff --git a/tests/unit/claude-web-transport.test.ts b/tests/unit/claude-web-transport.test.ts index 85f2e58467..08cf563248 100644 --- a/tests/unit/claude-web-transport.test.ts +++ b/tests/unit/claude-web-transport.test.ts @@ -407,7 +407,12 @@ describe("Claude Web executor transport orchestration", () => { assert.match(executorSource, /export class ClaudeWebExecutor extends BaseExecutor/); assert.doesNotMatch(executorSource, /claudeTurnstileSolver|getCfClearanceToken|tryBackedChat/); assert.doesNotMatch(indexSource, /ClaudeWebWithAutoRefresh/); - assert.match(indexSource, /"claude-web": new ClaudeWebExecutor\(\)/); - assert.match(indexSource, /"cw-web": new ClaudeWebExecutor\(\)/); + // Both aliases still resolve to ClaudeWebExecutor. Matched on the alias key + // and the class name rather than the exact construction spelling: #11421 made + // the map lazy (`() => import(…).then((m) => new m.ClaudeWebExecutor())`), and + // an anchor pinned to `new ClaudeWebExecutor()` went red for a change that + // never touched the wiring this test is here to guard. + assert.match(indexSource, /"claude-web":.*ClaudeWebExecutor/); + assert.match(indexSource, /"cw-web":.*ClaudeWebExecutor/); }); });