ci(check): fix test (#240)

* chore(embed): update test snapshot

* [autofix.ci] apply automated fixes

* chore(embed): update test

* chore(stream-object): update test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
藍+85CDandautofix-ci[bot] authored and GitHub committed 2025-12-20 21:10:01 +08:00
1 parent f02748b3a7
commit be7d4e000d
5 files changed
+5 -37

No files matched your search

@@ -606,7 +606,7 @@ exports[`@xsai/embed > embedMany 1`] = `
"-0.03",
"0.02",
"0.02",
"-0.01",
"-0.02",
"0.00",
"-0.02",
"-0.01",
+2 -2
View File
@@ -13,7 +13,7 @@ describe('@xsai/embed', () => {
})
expect(embeddings.map(toFixed)).toMatchSnapshot()
expect(usage.prompt_tokens).toBe(12)
expect(usage.total_tokens).toBe(12)
expect(usage.prompt_tokens).toBe(16)
expect(usage.total_tokens).toBe(16)
})
})
+2 -2
View File
@@ -13,7 +13,7 @@ describe('@xsai/embed', () => {
})
expect(toFixed(embedding)).toMatchSnapshot()
expect(usage.prompt_tokens).toBe(5)
expect(usage.total_tokens).toBe(5)
expect(usage.prompt_tokens).toBe(7)
expect(usage.total_tokens).toBe(7)
})
})
@@ -11,34 +11,3 @@ exports[`@xsai/stream-object > basic 2`] = `
"answer": "YES",
}
`;
exports[`@xsai/stream-object > object array with onFinish 1`] = `
[MockFunction spy] {
"calls": [
[
{
"finishReason": "stop",
"stepType": "initial",
"text": "{
"elements": [
{"fruit": "Apple"},
{"fruit": "Banana"},
{"fruit": "Orange"},
{"fruit": "Mango"},
{"fruit": "Pineapple"}
]
}",
"toolCalls": [],
"toolResults": [],
"usage": undefined,
},
],
],
"results": [
{
"type": "return",
"value": undefined,
},
],
}
`;
@@ -190,6 +190,5 @@ describe('@xsai/stream-object', () => {
expect(objects).toHaveLength(5)
expect(onFinish).toBeCalled()
expect(onFinish).toMatchSnapshot()
})
})