mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-22 07:07:53 +00:00
test: fix tests
This commit is contained in:
parent
bbf71ebd23
commit
8586ebcd54
@ -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,
|
||||
},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
@ -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$/,
|
||||
)
|
||||
})
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user