Repository navigation
Commit a326612
f0-1528
test(opencode-go,requesty): pin the abort assertions the new lint rule exposed
The compile arm failed on three lint errors after main was absorbed (merge commit
801a672, 602 files, no conflicts). Two of them sit in
src/api/providers/__tests__/opencode-go.spec.ts, a file this pull request never
touched: the branch adds abortSubstringSelector to the spec lint configs, and main's
already-merged assertions then fail that new rule on the merge ref. A head-only lint
run reports the same two rows one line earlier, at 1134 and 1485, so the failure is
the merge-tree class a head-only run cannot see. In the merged tree eslint reports
exactly the arm's three rows - 1135:10, 1486:10 and 964:36 - and exits 1.
opencode-go.spec.ts:1137 - the double is now one object shared by the two listeners
that race to reject the next() promise, and the test asserts rejects.toBe(abortDouble).
The stream path propagates the SDK-level rejection unchanged, so identity is the
strongest true statement; asserting an AbortError name and a provider message there
would assert a contract this handler does not have.
opencode-go.spec.ts:1495 - the Responses completion path wraps every failure
(opencode-go.ts:439 throws "Opencode Go completion error: <message>"), so the row
pins name "Error" and that whole message instead of a bare substring that a raw SDK
error would match too.
requesty.spec.ts:966 - the fixed sleep becomes the shared flushMacrotasks() helper
(src/test-utils/timers.ts): a rejection that ends up handled has no observable
condition to poll, which is what that helper is for, and setTimeout is what the rule
bans in specs.
Controls in this repo, on the merged tree: eslint over src exits 1 with those three
errors before the change and 0 after; the two spec files report 177 passed after it;
and mutating the two pinned details - asserting a fresh but equal error object, and
dropping the provider prefix from the message - fails exactly those two tests
("expected Error: request aborted to be Error: request aborted", and the mismatch on
{ name: 'Error', message: 'Opencode Go completion error: request aborted' }) and
nothing else. Test-only: no implementation file is touched, eslint-suppressions
counts are unchanged for every entry (opencode-go.spec.ts stays 3).1 parent 801a672 commit a326612
2 files changed
Lines changed: 25 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1103 | 1109 | | |
1104 | 1110 | | |
1105 | 1111 | | |
1106 | 1112 | | |
1107 | 1113 | | |
1108 | 1114 | | |
1109 | | - | |
| 1115 | + | |
1110 | 1116 | | |
1111 | 1117 | | |
1112 | 1118 | | |
| |||
1117 | 1123 | | |
1118 | 1124 | | |
1119 | 1125 | | |
1120 | | - | |
| 1126 | + | |
1121 | 1127 | | |
1122 | 1128 | | |
1123 | 1129 | | |
| |||
1132 | 1138 | | |
1133 | 1139 | | |
1134 | 1140 | | |
1135 | | - | |
| 1141 | + | |
1136 | 1142 | | |
1137 | 1143 | | |
1138 | 1144 | | |
| |||
1473 | 1479 | | |
1474 | 1480 | | |
1475 | 1481 | | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
1476 | 1488 | | |
1477 | | - | |
| 1489 | + | |
1478 | 1490 | | |
1479 | 1491 | | |
1480 | 1492 | | |
| |||
1483 | 1495 | | |
1484 | 1496 | | |
1485 | 1497 | | |
1486 | | - | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
1487 | 1502 | | |
1488 | 1503 | | |
1489 | 1504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
960 | 961 | | |
961 | 962 | | |
962 | 963 | | |
963 | | - | |
964 | | - | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
965 | 968 | | |
966 | 969 | | |
967 | 970 | | |
| |||
0 commit comments