Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ilharp committed Mar 13, 2024
1 parent bbf71eb commit 8586ebc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
],
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -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$/,
)
})
3 changes: 1 addition & 2 deletions packages/engine-chronocat-event/tests/mocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -11,7 +10,7 @@ export const ctx: ChronocatContext = {
debug: jest.fn(),
} as unknown as ChronocatContext['chronocat']['l'],
h,
},
} as ChronocatContext['chronocat'],
}

export const satoriConfig = {
Expand Down

0 comments on commit 8586ebc

Please sign in to comment.