test: fix tests

This commit is contained in:
Il Harper 2024-03-13 22:57:27 +08:00
parent bbf71ebd23
commit 8586ebcd54
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC
3 changed files with 6 additions and 15 deletions

View File

@ -55,15 +55,3 @@ exports[`Red 编码器应当正确编码 图片消息 1`] = `
],
]
`;
exports[`Red 编码器应当正确编码 图片消息 2`] = `
[
[
"file:///D:/Projects/chrononeko/chronocat02/packages/engine-chronocat-api/docs/static/chronocat.png",
{
"fileMime": undefined,
"fileName": undefined,
},
],
]
`;

View File

@ -34,5 +34,9 @@ test('Red 编码器应当正确编码 图片消息', async () => {
const saveCalls = save.mock.calls.map((x) => (x as unknown[]).slice(1))
expect(sendCalls).toMatchSnapshot()
expect(saveCalls).toMatchSnapshot()
expect(saveCalls[0]).toHaveLength(2)
expect((saveCalls[0] as [string])[0]).toMatch(
/\/docs\/static\/chronocat.png$/,
)
})

View File

@ -2,7 +2,6 @@ import type { ChronocatContext } from '@chronocat/shell'
import h from '@satorijs/element'
export const ctx: ChronocatContext = {
//@ts-expect-error aaa
chronocat: {
l: {
info: jest.fn(),
@ -11,7 +10,7 @@ export const ctx: ChronocatContext = {
debug: jest.fn(),
} as unknown as ChronocatContext['chronocat']['l'],
h,
},
} as ChronocatContext['chronocat'],
}
export const satoriConfig = {