SnowLuma v2.4.2 source snapshot
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
Publish MCP to npm / Build, test, and publish MCP (push) Waiting to run
Publish SDK to npm / Build, test, and publish SDK (push) Waiting to run
Sync action catalog to docs / sync (push) Waiting to run
Publish UI to npm / Build and publish UI (push) Waiting to run
Build and Release / preflight (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:02:00 +08:00
commit fa9c73363d
1367 files changed
+355735

No files matched your search

@@ -0,0 +1,42 @@
import { describe, expect, it } from 'vitest';
import { actionParams } from '../../sdk/tests/fixtures/action-contracts';
import { actions as extended } from '../src/actions/extended';
import { actions as friend } from '../src/actions/friend';
import { actions as albums } from '../src/actions/group-album';
import { actions as groupAdmin } from '../src/actions/group-admin';
import { actions as qzone } from '../src/actions/qzone';
import { actions as qzonePublic } from '../src/actions/qzone-public';
import { actions as streamDownload } from '../src/actions/stream-download';
import { actions as streamFile } from '../src/actions/stream-file';
const actions = [
...friend,
...extended,
...albums,
...groupAdmin,
...qzone,
...qzonePublic,
...streamDownload,
...streamFile,
];
const examples = Object.entries(actionParams).filter(
([name]) => name !== '.handle_quick_operation_async',
);
describe('SDK action parameter examples', () => {
it.each(examples)('%s matches the server input contract', (name, params) => {
const action = actions.find((entry) => entry.names.includes(name));
if (!action) {
throw new Error(`No server action for SDK example ${name}`);
}
expect(Object.keys(params).sort()).toEqual(
action
.describe()
.params.map(({ name }) => name)
.sort(),
);
expect(action.parse(params)).toMatchObject({ ok: true });
});
});