From d2097f77c8fbffcdb12a7e7f7ee8fd6e2ec491ad Mon Sep 17 00:00:00 2001 From: DrSmoothl <1787882683@qq.com> Date: Wed, 3 Jun 2026 22:17:58 +0800 Subject: [PATCH] test(sdk): remove obsolete actions-sync guard c49ae1c removed the SDK's hardcoded action-name list (src/actions.ts / SNOWLUMA_ACTIONS) and updated exports, but left the test that guarded it. The test imports SNOWLUMA_ACTIONS from ../src -- now undefined ("not iterable") -- and its registerAction('...') enumeration of onebot is itself stale after the declarative action-kit migration. Nothing else references SNOWLUMA_ACTIONS; the list it kept in sync no longer exists, so the guard is dead. Removing it makes the sdk suite green (16 tests). --- packages/sdk/tests/actions-sync.test.ts | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 packages/sdk/tests/actions-sync.test.ts diff --git a/packages/sdk/tests/actions-sync.test.ts b/packages/sdk/tests/actions-sync.test.ts deleted file mode 100644 index 41c79daf..00000000 --- a/packages/sdk/tests/actions-sync.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import fs from 'node:fs'; -import { fileURLToPath } from 'node:url'; -import { describe, expect, it } from 'vitest'; -import { SNOWLUMA_ACTIONS } from '../src'; - -describe('SnowLuma action list', () => { - it('stays in sync with core registerAction calls', () => { - // Actions moved out of @snowluma/core into the dedicated - // @snowluma/onebot package in the RoadMap #3 4-way split. - const actionsDir = fileURLToPath(new URL('../../onebot/src/actions/', import.meta.url)); - const registered = new Set(); - - for (const file of fs.readdirSync(actionsDir)) { - if (!file.endsWith('.ts')) continue; - const source = fs.readFileSync(new URL(file, `file://${actionsDir}/`), 'utf8'); - for (const match of source.matchAll(/registerAction\('([^']+)'/g)) { - registered.add(match[1]!); - } - } - - expect([...SNOWLUMA_ACTIONS].sort()).toEqual([...registered].sort()); - }); -});