Repository navigation
Commit 530033c
committed
test(requesty): pin the late-completion discard and the empty-content fallback
Rerunning the unit mutation preflight after the completePrompt fix left three
mutants on lines the rewrite touches, none of them reachable by the previous
tests:
- ConditionalExpression at requesty.ts:333 (the post-completion abort check,
replaced by false) survived because the new race settles at the abort, so no
test still reached that check. "discards a completion that resolves in the same
turn the caller aborts" makes the SDK win the race outright - it returns an
already-resolved response and aborts from a handler queued one step ahead of the
provider's continuation - and asserts the value is still discarded. Control:
deleting the check fails exactly that test with
"promise resolved \"'late'\" instead of rejecting".
- StringLiteral at requesty.ts:337 (the || "" fallback) was NoCoverage.
- OptionalChaining at requesty.ts:337 (choices[0]?.message) survived.
"returns an empty string when the completion carries an empty message content /
no choices at all" covers both: the string mutant fails both cases with
"expected 'Stryker was here!' to be ''", the optional-chain mutant fails the
no-choices case with "Cannot read properties of undefined (reading 'message')".
requesty.spec.ts 46/46 green; eslint --max-warnings=0, prettier --check and src
tsc --noEmit clean; no suppression and no Stryker directive added.1 parent 311f6b7 commit 530033c
1 file changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1010 | 1046 | | |
1011 | 1047 | | |
1012 | 1048 | | |
| |||
0 commit comments