mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-04 08:25:26 +08:00
fix: keep node error-branch token semantics and add grep fallback
This commit is contained in:
@@ -29,7 +29,7 @@ function parseChunkForContent(chunk, thinkingEnabled, currentType, stripReferenc
|
||||
finished: true,
|
||||
contentFilter: false,
|
||||
errorMessage: formatErrorMessage(chunk.error),
|
||||
outputTokens,
|
||||
outputTokens: 0,
|
||||
newType: currentType,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -17,6 +17,10 @@ trap cleanup EXIT
|
||||
if ! node --test --test-concurrency=1 tests/node/stream-tool-sieve.test.js tests/node/chat-stream.test.js tests/node/js_compat_test.js "$@" 2>&1 | tee "$NODE_TEST_LOG"; then
|
||||
echo
|
||||
echo "[run-unit-node] Node tests failed. 失败摘要如下:"
|
||||
rg -n "^(not ok|# fail)|ERR_TEST_FAILURE" "$NODE_TEST_LOG" || true
|
||||
if command -v rg >/dev/null 2>&1; then
|
||||
rg -n "^(not ok|# fail)|ERR_TEST_FAILURE" "$NODE_TEST_LOG" || true
|
||||
else
|
||||
grep -nE "^(not ok|# fail)|ERR_TEST_FAILURE" "$NODE_TEST_LOG" || true
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user